20#include <com/sun/star/rendering/CompositeOperation.hpp>
22#include <rtl/math.hxx>
24#include <vcl/font.hxx>
38using namespace std::placeholders;
83 const ::basegfx::B2DHomMatrix&,
86 const rendering::ARGBColor&,
93 const ::basegfx::B2DHomMatrix& rTransform,
96 const rendering::ARGBColor& rColor,
97 const geometry::RealPoint2D& rStartPoint,
98 const geometry::RealPoint2D& rEndPoint )
101 setupState(rTransform, eSrcBlend, eDstBlend, rColor);
104 glVertex2d(rStartPoint.X, rStartPoint.Y);
105 glVertex2d(rEndPoint.X, rEndPoint.Y);
112 const ::basegfx::B2DHomMatrix& rTransform,
115 const rendering::ARGBColor& rColor,
116 const ::basegfx::B2DPolyPolygonVector& rPolyPolygons )
119 setupState(rTransform, eSrcBlend, eDstBlend, rColor);
121 for(
const auto& rPoly : rPolyPolygons )
127 bool lcl_fillPolyPolygon(
const CanvasHelper& ,
128 const ::basegfx::B2DHomMatrix& rTransform,
131 const rendering::ARGBColor& rColor,
132 const ::basegfx::B2DPolyPolygonVector& rPolyPolygons )
134 TransformationPreserver aPreserver;
135 setupState(rTransform, eSrcBlend, eDstBlend, rColor);
137 for(
const auto& rPoly : rPolyPolygons )
139 glBegin( GL_TRIANGLES );
147 bool lcl_fillGradientPolyPolygon(
const CanvasHelper& rHelper,
148 const ::basegfx::B2DHomMatrix& rTransform,
151 const ::canvas::ParametricPolyPolygon::Values& rValues,
152 const rendering::Texture& rTexture,
153 const ::basegfx::B2DPolyPolygonVector& rPolyPolygons )
155 TransformationPreserver aPreserver;
156 setupState(rTransform, eSrcBlend, eDstBlend, rendering::ARGBColor());
161 ::basegfx::unotools::homMatrixFromAffineMatrix( aTextureTransform,
162 rTexture.AffineTransform );
164 for(
const auto& rPoly : rPolyPolygons )
165 aBounds.
expand( ::basegfx::utils::getRange( rPoly ) );
169 const sal_Int32 nNumCols=rValues.maColors.getLength();
170 uno::Sequence< rendering::ARGBColor > aColors(nNumCols);
171 rendering::ARGBColor*
const pColors=aColors.getArray();
172 rendering::ARGBColor* pCurrCol=pColors;
173 for( sal_Int32 i=0;
i<nNumCols; ++
i )
174 *pCurrCol++ = rHelper.getDevice()->getDeviceColorSpace()->convertToARGB(rValues.maColors[i])[0];
176 OSL_ASSERT(nNumCols == rValues.maStops.getLength());
178 switch( rValues.meType )
180 case ::canvas::ParametricPolyPolygon::GradientType::Linear:
181 rHelper.getDeviceHelper()->useLinearGradientShader(pColors,
186 case ::canvas::ParametricPolyPolygon::GradientType::Elliptical:
187 rHelper.getDeviceHelper()->useRadialGradientShader(pColors,
192 case ::canvas::ParametricPolyPolygon::GradientType::Rectangular:
193 rHelper.getDeviceHelper()->useRectangularGradientShader(pColors,
200 "CanvasHelper lcl_fillGradientPolyPolygon(): Unexpected case" );
204 for(
const auto& rPoly : rPolyPolygons )
206 glBegin(GL_TRIANGLES);
213 glMatrixMode(GL_MODELVIEW);
218 bool lcl_drawOwnBitmap(
const CanvasHelper& ,
219 const ::basegfx::B2DHomMatrix& rTransform,
222 const rendering::ARGBColor& rColor,
223 const CanvasBitmap& rBitmap )
225 TransformationPreserver aPreserver;
226 setupState(rTransform, eSrcBlend, eDstBlend, rColor);
228 return rBitmap.renderRecordedActions();
231 bool lcl_drawGenericBitmap(
const CanvasHelper& rHelper,
232 const ::basegfx::B2DHomMatrix& rTransform,
235 const rendering::ARGBColor& rColor,
236 const geometry::IntegerSize2D& rPixelSize,
237 const uno::Sequence<sal_Int8>& rPixelData,
238 sal_uInt32 nPixelCrc32 )
240 TransformationPreserver aPreserver;
241 setupState(rTransform, eSrcBlend, eDstBlend, rColor);
243 const unsigned int nTexId=rHelper.getDeviceHelper()->getTextureCache().getTexture(
244 rPixelSize, rPixelData.getConstArray(), nPixelCrc32);
246 glBindTexture(GL_TEXTURE_2D, nTexId);
247 glEnable(GL_TEXTURE_2D);
248 glTexParameteri(GL_TEXTURE_2D,
249 GL_TEXTURE_MIN_FILTER,
251 glTexParameteri(GL_TEXTURE_2D,
252 GL_TEXTURE_MAG_FILTER,
255 glBlendFunc(GL_SRC_ALPHA,
256 GL_ONE_MINUS_SRC_ALPHA);
261 glBegin(GL_TRIANGLE_STRIP);
262 glTexCoord2f(0,0); glVertex2d(0,0);
263 glTexCoord2f(0,1); glVertex2d(0, rPixelSize.Height);
264 glTexCoord2f(1,0); glVertex2d(rPixelSize.Width,0);
265 glTexCoord2f(1,1); glVertex2d(rPixelSize.Width,rPixelSize.Height);
268 glBindTexture(GL_TEXTURE_2D, 0);
269 glDisable(GL_TEXTURE_2D);
274 bool lcl_fillTexturedPolyPolygon(
const CanvasHelper& rHelper,
275 const ::basegfx::B2DHomMatrix& rTransform,
278 const rendering::Texture& rTexture,
279 const geometry::IntegerSize2D& rPixelSize,
280 const uno::Sequence<sal_Int8>& rPixelData,
281 sal_uInt32 nPixelCrc32,
282 const ::basegfx::B2DPolyPolygonVector& rPolyPolygons )
284 TransformationPreserver aPreserver;
285 setupState(rTransform, eSrcBlend, eDstBlend, rendering::ARGBColor());
287 const unsigned int nTexId=rHelper.getDeviceHelper()->getTextureCache().getTexture(
288 rPixelSize, rPixelData.getConstArray(), nPixelCrc32);
290 glBindTexture(GL_TEXTURE_2D, nTexId);
291 glEnable(GL_TEXTURE_2D);
292 glTexParameteri(GL_TEXTURE_2D,
293 GL_TEXTURE_MIN_FILTER,
295 glTexParameteri(GL_TEXTURE_2D,
296 GL_TEXTURE_MAG_FILTER,
299 glBlendFunc(GL_SRC_ALPHA,
300 GL_ONE_MINUS_SRC_ALPHA);
305 ::basegfx::unotools::homMatrixFromAffineMatrix( aTextureTransform,
306 rTexture.AffineTransform );
308 for(
const auto& rPolyPolygon : rPolyPolygons )
309 aBounds.
expand( ::basegfx::utils::getRange( rPolyPolygon ) );
312 aTextureTransform.
invert();
314 glMatrixMode(GL_TEXTURE);
315 double aTexTransform[] =
317 aTextureTransform.
get(0,0), aTextureTransform.
get(1,0), 0, 0,
318 aTextureTransform.
get(0,1), aTextureTransform.
get(1,1), 0, 0,
320 aTextureTransform.
get(0,2), aTextureTransform.
get(1,2), 0, 1
322 glLoadMatrixd(aTexTransform);
325 glColor4f(1,1,1,rTexture.Alpha);
327 for(
const auto& rPolyPolygon : rPolyPolygons )
329 glBegin(GL_TRIANGLES);
335 glMatrixMode(GL_MODELVIEW);
337 glBindTexture(GL_TEXTURE_2D, 0);
338 glDisable(GL_TEXTURE_2D);
346 mpDeviceHelper( nullptr )
381 const geometry::RealPoint2D& aStartPoint,
382 const geometry::RealPoint2D& aEndPoint,
383 const rendering::ViewState& viewState,
384 const rendering::RenderState& renderState )
392 rAct.maFunction = std::bind(&lcl_drawLine,
393 std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5,
394 aStartPoint, aEndPoint);
399 const geometry::RealBezierSegment2D& aBezierSegment,
400 const geometry::RealPoint2D& aEndPoint,
401 const rendering::ViewState& viewState,
402 const rendering::RenderState& renderState )
413 rAct.maFunction = std::bind(&lcl_drawLine,
414 std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5,
415 geometry::RealPoint2D(
422 const uno::Reference< rendering::XPolyPolygon2D >& xPolyPolygon,
423 const rendering::ViewState& viewState,
424 const rendering::RenderState& renderState )
427 "CanvasHelper::drawPolyPolygon: polygon is NULL");
435 rAct.maPolyPolys.push_back(
436 ::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(xPolyPolygon));
437 rAct.maPolyPolys.back().makeUnique();
439 rAct.maFunction = &lcl_drawPolyPolygon;
443 return uno::Reference< rendering::XCachedPrimitive >(
nullptr);
447 const uno::Reference< rendering::XPolyPolygon2D >& xPolyPolygon,
448 const rendering::ViewState& viewState,
449 const rendering::RenderState& renderState,
450 const rendering::StrokeAttributes& )
453 "CanvasHelper::strokePolyPolygon: polygon is NULL");
461 rAct.maPolyPolys.push_back(
462 ::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(xPolyPolygon));
463 rAct.maPolyPolys.back().makeUnique();
466 rAct.maFunction = &lcl_drawPolyPolygon;
470 return uno::Reference< rendering::XCachedPrimitive >(
nullptr);
474 const uno::Reference< rendering::XPolyPolygon2D >& ,
475 const rendering::ViewState& ,
476 const rendering::RenderState& ,
477 const uno::Sequence< rendering::Texture >& ,
478 const rendering::StrokeAttributes& )
481 return uno::Reference< rendering::XCachedPrimitive >(
nullptr);
485 const uno::Reference< rendering::XPolyPolygon2D >& ,
486 const rendering::ViewState& ,
487 const rendering::RenderState& ,
488 const uno::Sequence< rendering::Texture >& ,
489 const uno::Reference< geometry::XMapping2D >& ,
490 const rendering::StrokeAttributes& )
493 return uno::Reference< rendering::XCachedPrimitive >(
nullptr);
497 const uno::Reference< rendering::XPolyPolygon2D >& ,
498 const rendering::ViewState& ,
499 const rendering::RenderState& ,
500 const rendering::StrokeAttributes& )
503 return uno::Reference< rendering::XPolyPolygon2D >(
nullptr);
507 const uno::Reference< rendering::XPolyPolygon2D >& xPolyPolygon,
508 const rendering::ViewState& viewState,
509 const rendering::RenderState& renderState )
512 "CanvasHelper::fillPolyPolygon: polygon is NULL");
520 rAct.maPolyPolys.push_back(
521 ::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(xPolyPolygon));
522 rAct.maPolyPolys.back().makeUnique();
524 rAct.maFunction = &lcl_fillPolyPolygon;
528 return uno::Reference< rendering::XCachedPrimitive >(
nullptr);
532 const uno::Reference< rendering::XPolyPolygon2D >& xPolyPolygon,
533 const rendering::ViewState& viewState,
534 const rendering::RenderState& renderState,
535 const uno::Sequence< rendering::Texture >& textures )
538 "CanvasHelper::fillPolyPolygon: polygon is NULL");
546 rAct.maPolyPolys.push_back(
547 ::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(xPolyPolygon));
548 rAct.maPolyPolys.back().makeUnique();
562 const ::canvas::ParametricPolyPolygon::Values& rValues(
565 rAct.maFunction = std::bind(&lcl_fillGradientPolyPolygon,
566 std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4,
569 std::placeholders::_6);
575 "CanvasHelper::fillTexturedPolyPolygon(): unknown parametric polygon encountered" );
578 else if( textures[0].
Bitmap.is() )
581 CanvasBitmap* pOwnBitmap=
dynamic_cast<CanvasBitmap*
>(textures[0].Bitmap.get());
590 uno::Reference< rendering::XIntegerReadOnlyBitmap > xIntegerBitmap(
593 if( xIntegerBitmap.is() )
595 const geometry::IntegerSize2D aSize=xIntegerBitmap->getSize();
596 rendering::IntegerBitmapLayout aLayout;
597 uno::Sequence<sal_Int8> aPixelData=
598 xIntegerBitmap->getData(
600 geometry::IntegerRectangle2D(0,0,aSize.Width,aSize.Height));
603 uno::Sequence<sal_Int8> aARGBBytes(
604 aLayout.ColorSpace->convertToIntegerColorSpace(
608 rAct.maFunction = std::bind(&lcl_fillTexturedPolyPolygon,
609 std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4,
614 aARGBBytes.getConstArray(),
615 aARGBBytes.getLength()),
616 std::placeholders::_6);
624 return uno::Reference< rendering::XCachedPrimitive >(
nullptr);
628 const uno::Reference< rendering::XPolyPolygon2D >& ,
629 const rendering::ViewState& ,
630 const rendering::RenderState& ,
631 const uno::Sequence< rendering::Texture >& ,
632 const uno::Reference< geometry::XMapping2D >& )
635 return uno::Reference< rendering::XCachedPrimitive >(
nullptr);
639 const rendering::FontRequest& fontRequest,
640 const uno::Sequence< beans::PropertyValue >& extraFontProperties,
641 const geometry::Matrix2D& fontMatrix )
644 return uno::Reference< rendering::XCanvasFont >(
645 new CanvasFont(fontRequest, extraFontProperties, fontMatrix ) );
647 return uno::Reference< rendering::XCanvasFont >();
651 const rendering::FontInfo& ,
652 const uno::Sequence< beans::PropertyValue >& )
655 return uno::Sequence< rendering::FontInfo >();
659 const rendering::StringContext& ,
660 const uno::Reference< rendering::XCanvasFont >& ,
661 const rendering::ViewState& ,
662 const rendering::RenderState& ,
666 return uno::Reference< rendering::XCachedPrimitive >(
nullptr);
670 const uno::Reference< rendering::XTextLayout >& xLayoutetText,
671 const rendering::ViewState& viewState,
672 const rendering::RenderState& renderState )
675 "CanvasHelper::drawTextLayout: text is NULL");
680 pVDev->EnableOutput(
false);
682 auto pLayoutFont = xLayoutetText->getFont();
683 CanvasFont* pFont=
dynamic_cast<CanvasFont*
>(pLayoutFont.get());
684 const rendering::StringContext& rTxt=xLayoutetText->getText();
685 if( pFont && rTxt.Length )
688 const rendering::FontRequest& rFontRequest = pFont->getFontRequest();
689 const geometry::Matrix2D& rFontMatrix = pFont->getFontMatrix();
691 rFontRequest.FontDescription.FamilyName,
692 rFontRequest.FontDescription.StyleName,
693 Size( 0, ::basegfx::fround(rFontRequest.CellSize)));
695 aFont.SetAlignment( ALIGN_BASELINE );
696 aFont.SetCharSet( (rFontRequest.FontDescription.IsSymbolFont==util::TriState_YES) ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE );
697 aFont.SetVertical( rFontRequest.FontDescription.IsVertical==util::TriState_YES );
698 aFont.SetWeight(
static_cast<FontWeight>(rFontRequest.FontDescription.FontDescription.Weight) );
699 aFont.SetItalic( (rFontRequest.FontDescription.FontDescription.Letterform<=8) ? ITALIC_NONE : ITALIC_NORMAL );
701 if (pFont->getEmphasisMark())
705 if(!::rtl::math::approxEqual(rFontMatrix.m00, rFontMatrix.m11))
707 const Size aSize = pVDev->GetFontMetric( aFont ).GetFontSize();
708 const double fDividend( rFontMatrix.m10 + rFontMatrix.m11 );
709 double fStretch = rFontMatrix.m00 + rFontMatrix.m01;
711 if( !::basegfx::fTools::equalZero( fDividend) )
712 fStretch /= fDividend;
714 const sal_Int32 nNewWidth = ::basegfx::fround( aSize.
Width() * fStretch );
716 aFont.SetAverageFontWidth( nNewWidth );
720 pVDev->SetFont(aFont);
728 uno::Sequence<double> aLogicalAdvancements=xLayoutetText->queryLogicalAdvancements();
729 if( aLogicalAdvancements.hasElements() )
732 const sal_Int32 nLen( aLogicalAdvancements.getLength() );
735 for( sal_Int32 i=0;
i<nLen; ++
i )
738 uno::Sequence<sal_Bool> aKashidaPositions=xLayoutetText->queryKashidaPositions();
742 pVDev->GetTextOutlines(rAct.maPolyPolys,
754 pVDev->GetTextOutlines(rAct.maPolyPolys,
762 for(
auto& rPoly : rAct.maPolyPolys )
765 rAct.maFunction = &lcl_fillPolyPolygon;
770 return uno::Reference< rendering::XCachedPrimitive >(
nullptr);
774 const uno::Reference< rendering::XBitmap >& xBitmap,
775 const rendering::ViewState& viewState,
776 const rendering::RenderState& renderState )
779 "CanvasHelper::drawBitmap: bitmap is NULL");
784 CanvasBitmap* pOwnBitmap=
dynamic_cast<CanvasBitmap*
>(xBitmap.get());
794 rAct.maFunction = std::bind(&lcl_drawOwnBitmap,
795 std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5,
802 uno::Reference< rendering::XIntegerReadOnlyBitmap > xIntegerBitmap(
803 xBitmap, uno::UNO_QUERY);
804 if( xIntegerBitmap.is() )
806 const geometry::IntegerSize2D aSize=xBitmap->getSize();
807 rendering::IntegerBitmapLayout aLayout;
808 uno::Sequence<sal_Int8> aPixelData=
809 xIntegerBitmap->getData(
811 geometry::IntegerRectangle2D(0,0,aSize.Width,aSize.Height));
814 uno::Sequence<sal_Int8> aARGBBytes(
815 aLayout.ColorSpace->convertToIntegerColorSpace(
823 rAct.maFunction = std::bind(&lcl_drawGenericBitmap,
824 std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5,
827 aARGBBytes.getConstArray(),
828 aARGBBytes.getLength()));
835 return uno::Reference< rendering::XCachedPrimitive >(
nullptr);
839 const uno::Reference< rendering::XBitmap >& xBitmap,
840 const rendering::ViewState& viewState,
841 const rendering::RenderState& renderState )
844 return drawBitmap(pCanvas, xBitmap, viewState, renderState);
849 const rendering::ViewState& viewState,
850 const rendering::RenderState& renderState )
853 "CanvasHelper::setupGraphicsState: reference device invalid" );
865 switch( renderState.CompositeOperation )
867 case rendering::CompositeOperation::OVER:
868 o_action.meSrcBlendMode=GL_ONE;
869 o_action.meDstBlendMode=GL_ONE_MINUS_SRC_ALPHA;
871 case rendering::CompositeOperation::CLEAR:
872 o_action.meSrcBlendMode=GL_ZERO;
873 o_action.meDstBlendMode=GL_ZERO;
875 case rendering::CompositeOperation::SOURCE:
876 o_action.meSrcBlendMode=GL_ONE;
877 o_action.meDstBlendMode=GL_ZERO;
879 case rendering::CompositeOperation::UNDER:
880 case rendering::CompositeOperation::DESTINATION:
881 o_action.meSrcBlendMode=GL_ZERO;
882 o_action.meDstBlendMode=GL_ONE;
884 case rendering::CompositeOperation::INSIDE:
885 o_action.meSrcBlendMode=GL_DST_ALPHA;
886 o_action.meDstBlendMode=GL_ZERO;
888 case rendering::CompositeOperation::INSIDE_REVERSE:
889 o_action.meSrcBlendMode=GL_ONE_MINUS_DST_ALPHA;
890 o_action.meDstBlendMode=GL_ZERO;
892 case rendering::CompositeOperation::OUTSIDE:
893 o_action.meSrcBlendMode=GL_ONE_MINUS_DST_ALPHA;
894 o_action.meDstBlendMode=GL_ONE;
896 case rendering::CompositeOperation::OUTSIDE_REVERSE:
897 o_action.meSrcBlendMode=GL_ZERO;
898 o_action.meDstBlendMode=GL_ONE_MINUS_SRC_ALPHA;
900 case rendering::CompositeOperation::ATOP:
901 o_action.meSrcBlendMode=GL_DST_ALPHA;
902 o_action.meDstBlendMode=GL_ONE_MINUS_SRC_ALPHA;
904 case rendering::CompositeOperation::ATOP_REVERSE:
905 o_action.meSrcBlendMode=GL_ONE_MINUS_DST_ALPHA;
906 o_action.meDstBlendMode=GL_SRC_ALPHA;
908 case rendering::CompositeOperation::XOR:
909 o_action.meSrcBlendMode=GL_ONE_MINUS_DST_ALPHA;
910 o_action.meDstBlendMode=GL_ONE_MINUS_SRC_ALPHA;
912 case rendering::CompositeOperation::ADD:
913 o_action.meSrcBlendMode=GL_ONE;
914 o_action.meDstBlendMode=GL_ONE;
916 case rendering::CompositeOperation::SATURATE:
917 o_action.meSrcBlendMode=GL_SRC_ALPHA_SATURATE;
918 o_action.meDstBlendMode=GL_SRC_ALPHA_SATURATE;
922 ENSURE_OR_THROW(
false,
"CanvasHelper::setupGraphicsState: unexpected mode" );
926 if (renderState.DeviceColor.hasElements())
927 o_action.maARGBColor =
928 mpDevice->getDeviceColorSpace()->convertToARGB(renderState.DeviceColor)[0];
935 if( !rRecordedAction.maFunction( *
this,
936 rRecordedAction.maTransform,
937 rRecordedAction.meSrcBlendMode,
938 rRecordedAction.meDstBlendMode,
939 rRecordedAction.maARGBColor,
940 rRecordedAction.maPolyPolys ) )
void resize(size_t nSize)
void set(size_t nIndex, sal_Int32 nValue)
constexpr tools::Long Width() const
void translate(double fX, double fY)
double get(sal_uInt16 nRow, sal_uInt16 nColumn) const
void scale(double fX, double fY)
void expand(const Tuple2D< TYPE > &rTuple)
Values getValues() const
Query all defining values of this object atomically.
void swap(cow_wrapper &r)
Helper class for basic canvas functionality.
css::uno::Reference< css::rendering::XCachedPrimitive > drawPolyPolygon(const css::rendering::XCanvas *pCanvas, const css::uno::Reference< css::rendering::XPolyPolygon2D > &xPolyPolygon, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState)
SpriteDeviceHelper * mpDeviceHelper
Internal helper - used for a few global GL objects, e.g.
void drawLine(const css::rendering::XCanvas *pCanvas, const css::geometry::RealPoint2D &aStartPoint, const css::geometry::RealPoint2D &aEndPoint, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState)
css::uno::Reference< css::rendering::XPolyPolygon2D > queryStrokeShapes(const css::rendering::XCanvas *pCanvas, const css::uno::Reference< css::rendering::XPolyPolygon2D > &xPolyPolygon, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState, const css::rendering::StrokeAttributes &strokeAttributes)
css::uno::Reference< css::rendering::XCachedPrimitive > strokeTexturedPolyPolygon(const css::rendering::XCanvas *pCanvas, const css::uno::Reference< css::rendering::XPolyPolygon2D > &xPolyPolygon, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState, const css::uno::Sequence< css::rendering::Texture > &textures, const css::rendering::StrokeAttributes &strokeAttributes)
css::uno::Reference< css::rendering::XCachedPrimitive > fillTexturedPolyPolygon(const css::rendering::XCanvas *pCanvas, const css::uno::Reference< css::rendering::XPolyPolygon2D > &xPolyPolygon, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState, const css::uno::Sequence< css::rendering::Texture > &textures)
void drawBezier(const css::rendering::XCanvas *pCanvas, const css::geometry::RealBezierSegment2D &aBezierSegment, const css::geometry::RealPoint2D &aEndPoint, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState)
css::uno::Reference< css::rendering::XCachedPrimitive > drawBitmapModulated(const css::rendering::XCanvas *pCanvas, const css::uno::Reference< css::rendering::XBitmap > &xBitmap, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState)
RecordVectorT mpRecordedActions
Ptr to array of recorded render calls.
CanvasHelper & operator=(const CanvasHelper &)
bool renderRecordedActions() const
Write out recorded actions.
css::uno::Reference< css::rendering::XCachedPrimitive > drawBitmap(const css::rendering::XCanvas *pCanvas, const css::uno::Reference< css::rendering::XBitmap > &xBitmap, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState)
css::rendering::XGraphicDevice * mpDevice
Phyical output device.
css::uno::Sequence< css::rendering::FontInfo > queryAvailableFonts(const css::rendering::XCanvas *pCanvas, const css::rendering::FontInfo &aFilter, const css::uno::Sequence< css::beans::PropertyValue > &aFontProperties)
css::uno::Reference< css::rendering::XCachedPrimitive > fillTextureMappedPolyPolygon(const css::rendering::XCanvas *pCanvas, const css::uno::Reference< css::rendering::XPolyPolygon2D > &xPolyPolygon, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState, const css::uno::Sequence< css::rendering::Texture > &textures, const css::uno::Reference< css::geometry::XMapping2D > &xMapping)
void init(css::rendering::XGraphicDevice &rDevice, SpriteDeviceHelper &rDeviceHelper)
Initialize canvas helper.
css::uno::Reference< css::rendering::XCachedPrimitive > drawText(const css::rendering::XCanvas *pCanvas, const css::rendering::StringContext &text, const css::uno::Reference< css::rendering::XCanvasFont > &xFont, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState, sal_Int8 textDirection)
void disposing()
Release all references.
size_t getRecordedActionCount() const
Retrieve number of recorded actions.
css::uno::Reference< css::rendering::XCanvasFont > createFont(const css::rendering::XCanvas *pCanvas, const css::rendering::FontRequest &fontRequest, const css::uno::Sequence< css::beans::PropertyValue > &extraFontProperties, const css::geometry::Matrix2D &fontMatrix)
css::uno::Reference< css::rendering::XCachedPrimitive > fillPolyPolygon(const css::rendering::XCanvas *pCanvas, const css::uno::Reference< css::rendering::XPolyPolygon2D > &xPolyPolygon, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState)
void setupGraphicsState(Action &o_action, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState)
css::uno::Reference< css::rendering::XCachedPrimitive > strokePolyPolygon(const css::rendering::XCanvas *pCanvas, const css::uno::Reference< css::rendering::XPolyPolygon2D > &xPolyPolygon, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState, const css::rendering::StrokeAttributes &strokeAttributes)
css::uno::Reference< css::rendering::XCachedPrimitive > drawTextLayout(const css::rendering::XCanvas *pCanvas, const css::uno::Reference< css::rendering::XTextLayout > &layoutetText, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState)
css::uno::Reference< css::rendering::XCachedPrimitive > strokeTextureMappedPolyPolygon(const css::rendering::XCanvas *pCanvas, const css::uno::Reference< css::rendering::XPolyPolygon2D > &xPolyPolygon, const css::rendering::ViewState &viewState, const css::rendering::RenderState &renderState, const css::uno::Sequence< css::rendering::Texture > &textures, const css::uno::Reference< css::geometry::XMapping2D > &xMapping, const css::rendering::StrokeAttributes &strokeAttributes)
#define ENSURE_OR_THROW(c, m)
sal::systools::COMReference< IDirect3DDevice9 > mpDevice
::std::vector< B2DPolyPolygon > B2DPolyPolygonVector
B2IRange fround(const B2DRange &rRange)
void renderComplexPolyPolygon(const ::basegfx::B2DPolyPolygon &rPolyPoly)
triangulates polygon before
void setupState(const ::basegfx::B2DHomMatrix &rTransform, GLenum eSrcBlend, GLenum eDstBlend, const rendering::ARGBColor &rColor)
void renderPolyPolygon(const ::basegfx::B2DPolyPolygon &rPolyPoly)
only use this for line polygons.
::basegfx::B2DPolyPolygonVector maPolyPolys
rendering::ARGBColor maARGBColor
std::function< bool(const CanvasHelper &, const ::basegfx::B2DHomMatrix &, GLenum, GLenum, const rendering::ARGBColor &, const ::basegfx::B2DPolyPolygonVector &)> maFunction
::basegfx::B2DHomMatrix maTransform