32 std::shared_ptr<IColorBuffer> xColorBuffer,
33 const ::basegfx::B2IPoint& rPos,
34 const ::basegfx::B2ISize& rSize ) :
35 mpColorBuffer(
std::move(xColorBuffer)),
61 const double pw( aPageSize.
getWidth() );
63 const double ox( aDestOffset.
getX() );
64 const double oy( aDestOffset.
getY() );
68 return ::basegfx::B2DRectangle( ox/pw,
75 const ::basegfx::B2ISize& rSize )
const
79 const double pw( aPageSize.
getWidth() );
81 const double ox( rPos.getX() );
82 const double oy( rPos.getY() );
83 const double sx( rSize.getWidth() );
84 const double sy( rSize.getHeight() );
86 return ::basegfx::B2DRectangle( ox/pw,
93 const ::basegfx::B2DPoint& rPos,
94 const ::basegfx::B2DHomMatrix& rTransform )
96 std::shared_ptr<IRenderModule> pRenderModule(
mpPageManager->getRenderModule());
103 const ::basegfx::B2DRectangle& rUV(
getUVCoords() );
105 const double u1(rUV.getMinX());
106 const double v1(rUV.getMinY());
107 const double u2(rUV.getMaxX());
108 const double v2(rUV.getMaxY());
119 aTransform = aTransform * rTransform;
120 aTransform.
translate(::basegfx::fround(rPos.getX()),
121 ::basegfx::fround(rPos.getY()));
157 vertex.
a =
static_cast<float>(fAlpha);
164 const ::comphelper::ScopeGuard aScopeGuard(
165 [&pRenderModule]()
mutable { pRenderModule->endPrimitive(); } );
167 vertex.
u=
static_cast<float>(u2); vertex.
v=
static_cast<float>(v2);
168 vertex.
x=
static_cast<float>(p0.getX()); vertex.
y=
static_cast<float>(p0.getY());
169 pRenderModule->pushVertex(vertex);
171 vertex.
u=
static_cast<float>(u1); vertex.
v=
static_cast<float>(v2);
172 vertex.
x=
static_cast<float>(p1.getX()); vertex.
y=
static_cast<float>(p1.getY());
173 pRenderModule->pushVertex(vertex);
175 vertex.
u=
static_cast<float>(u1); vertex.
v=
static_cast<float>(v1);
176 vertex.
x=
static_cast<float>(p2.getX()); vertex.
y=
static_cast<float>(p2.getY());
177 pRenderModule->pushVertex(vertex);
179 vertex.
u=
static_cast<float>(u2); vertex.
v=
static_cast<float>(v1);
180 vertex.
x=
static_cast<float>(p3.getX()); vertex.
y=
static_cast<float>(p3.getY());
181 pRenderModule->pushVertex(vertex);
184 return !(pRenderModule->isError());
189 const ::basegfx::B2DPoint& rPos,
190 const ::basegfx::B2DRectangle& rArea,
191 const ::basegfx::B2DHomMatrix& rTransform )
193 if( rArea.isEmpty() )
196 std::shared_ptr<IRenderModule> pRenderModule(
mpPageManager->getRenderModule());
204 ::basegfx::fround(rArea.getMinimum().getX()),
205 ::basegfx::fround(rArea.getMinimum().getY()));
207 ::basegfx::fround(rArea.getMaximum().getX()),
208 ::basegfx::fround(rArea.getMaximum().getY()) );
218 if(aSize.
getX() <= 0 || aSize.
getY() <= 0)
226 const ::basegfx::B2DRectangle& rUV(
229 const double u1(rUV.getMinX());
230 const double v1(rUV.getMinY());
231 const double u2(rUV.getMaxX());
232 const double v2(rUV.getMaxY());
239 aTransform = aTransform * rTransform;
240 aTransform.
translate(::basegfx::fround(rPos.getX()),
241 ::basegfx::fround(rPos.getY()));
278 vertex.
a =
static_cast<float>(fAlpha);
285 const ::comphelper::ScopeGuard aScopeGuard(
286 [&pRenderModule]()
mutable { pRenderModule->endPrimitive(); } );
288 vertex.
u=
static_cast<float>(u2); vertex.
v=
static_cast<float>(v2);
289 vertex.
x=
static_cast<float>(p0.getX()); vertex.
y=
static_cast<float>(p0.getY());
290 pRenderModule->pushVertex(vertex);
292 vertex.
u=
static_cast<float>(u1); vertex.
v=
static_cast<float>(v2);
293 vertex.
x=
static_cast<float>(p1.getX()); vertex.
y=
static_cast<float>(p1.getY());
294 pRenderModule->pushVertex(vertex);
296 vertex.
u=
static_cast<float>(u1); vertex.
v=
static_cast<float>(v1);
297 vertex.
x=
static_cast<float>(p2.getX()); vertex.
y=
static_cast<float>(p2.getY());
298 pRenderModule->pushVertex(vertex);
300 vertex.
u=
static_cast<float>(u2); vertex.
v=
static_cast<float>(v1);
301 vertex.
x=
static_cast<float>(p3.getX()); vertex.
y=
static_cast<float>(p3.getY());
302 pRenderModule->pushVertex(vertex);
305 return !(pRenderModule->isError());
309 const ::basegfx::B2DPoint& rPos,
310 const ::basegfx::B2DPolygon& rClipPoly,
311 const ::basegfx::B2DHomMatrix& rTransform )
313 std::shared_ptr<IRenderModule> pRenderModule(
mpPageManager->getRenderModule());
315 RenderModuleGuard aGuard( pRenderModule );
326 const double x2(x1+
w);
327 const double y2(y1+
h);
328 const ::basegfx::B2DRectangle aSurfaceClipRect(x1,y1,x2,y2);
336 aTransform.
translate(::basegfx::fround(rPos.getX()),
337 ::basegfx::fround(rPos.getY()));
366 const ::basegfx::B2DRectangle& rUV(
getUVCoords() );
372 if(
const sal_uInt32 nVertexCount = rTriangleList.
count())
378 vertex.
a =
static_cast<float>(fAlpha);
384 const ::comphelper::ScopeGuard aScopeGuard(
385 [&pRenderModule]()
mutable { pRenderModule->endPrimitive(); } );
391 const double tu(((aPoint.
getX()-aSurfaceClipRect.getMinX())*rUV.getWidth()/w)+rUV.getMinX());
392 const double tv(((aPoint.
getY()-aSurfaceClipRect.getMinY())*rUV.getHeight()/h)+rUV.getMinY());
393 vertex.
u=
static_cast<float>(tu);
394 vertex.
v=
static_cast<float>(tv);
395 vertex.
x=
static_cast<float>(aTransformedPoint.getX());
396 vertex.
y=
static_cast<float>(aTransformedPoint.getY());
397 pRenderModule->pushVertex(vertex);
401 return !(pRenderModule->isError());
void translate(double fX, double fY)
basegfx::B2DPoint const & getB2DPoint(sal_uInt32 nIndex) const
Little RAII wrapper for guarding access to IRenderModule interface.
void setColorBufferDirty()
Surface(PageManagerSharedPtr xPageManager, std::shared_ptr< IColorBuffer > xColorBuffer, const ::basegfx::B2IPoint &rPos, const ::basegfx::B2ISize &rSize)
bool drawRectangularArea(double fAlpha, const ::basegfx::B2DPoint &rPos, const ::basegfx::B2DRectangle &rArea, const ::basegfx::B2DHomMatrix &rTransform)
Render the surface content to screen.
PageManagerSharedPtr mpPageManager
std::shared_ptr< IColorBuffer > mpColorBuffer
basegfx::B2DRectangle getUVCoords() const
::basegfx::B2IPoint maSourceOffset
::basegfx::B2ISize maSize
bool drawWithClip(double fAlpha, const ::basegfx::B2DPoint &rPos, const ::basegfx::B2DPolygon &rClipPoly, const ::basegfx::B2DHomMatrix &rTransform)
Render the surface content to screen.
FragmentSharedPtr mpFragment
bool draw(double fAlpha, const ::basegfx::B2DPoint &rPos, const ::basegfx::B2DHomMatrix &rTransform)
Render the surface content to screen.
::basegfx::B2ISize maSize
B2DPolygon clipTriangleListOnRange(const B2DPolygon &rCandidate, const B2DRange &rRange)
B2DHomMatrix createTranslateB2DHomMatrix(double fTranslateX, double fTranslateY)
std::shared_ptr< PageManager > PageManagerSharedPtr
PageManagerSharedPtr mpPageManager