[Libreoffice-commits] core.git: cppcanvas/source
Armin Le Grand
Armin.Le.Grand at cib.de
Sun Feb 28 10:11:35 UTC 2016
cppcanvas/source/mtfrenderer/transparencygroupaction.cxx | 10 ++++++++++
1 file changed, 10 insertions(+)
New commits:
commit 1c85800345239754d5c4ec71c2aad526d0439eea
Author: Armin Le Grand <Armin.Le.Grand at cib.de>
Date: Fri Feb 26 16:37:32 2016 +0100
tdf#95709 adapt clip polygon for transparence groups
For presentation transparence groups are rendered by the canvas
using VirtualDevices and Bitmaps. To adapt for then painting
the Bitnmap to the canvas the RenderState needs to be adapted
to e.g. reflect the already applied scaling. Missing was to adapt
a set clip polyPolygon to be synchronized with the new RenderState
transformation.
Change-Id: If760a8076e016a6dcf306db71971f1fd2fef7017
Reviewed-on: https://gerrit.libreoffice.org/22720
Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
diff --git a/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx b/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx
index 52c94b7..a8f61f2 100644
--- a/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx
+++ b/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx
@@ -46,6 +46,7 @@
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/tuple/b2dtuple.hxx>
#include <basegfx/tools/canvastools.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <boost/noncopyable.hpp>
@@ -373,6 +374,15 @@ namespace cppcanvas
rendering::RenderState aLocalState( maState );
::canvas::tools::setRenderStateTransform(aLocalState, aTransform);
+ if(aLocalState.Clip.is())
+ {
+ // tdf#95709
+ // Adjust renderstate clip to modified scale from above
+ ::basegfx::B2DPolyPolygon aClip = ::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(aLocalState.Clip);
+ aClip.transform(basegfx::tools::createScaleB2DHomMatrix(aScale));
+ aLocalState.Clip = ::basegfx::unotools::xPolyPolygonFromB2DPolyPolygon(mpCanvas->getUNOCanvas()->getDevice(), aClip);
+ }
+
#if OSL_DEBUG_LEVEL > 2
aLocalState.Clip.clear();
aLocalState.DeviceColor =
More information about the Libreoffice-commits
mailing list