[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - cppcanvas/source
Armin Le Grand
Armin.Le.Grand at cib.de
Fri Mar 4 14:46:13 UTC 2016
cppcanvas/source/mtfrenderer/transparencygroupaction.cxx | 10 ++++++++++
1 file changed, 10 insertions(+)
New commits:
commit d0244e043c1aca4a9e63313998254202e40f113b
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>
(cherry picked from commit 1c85800345239754d5c4ec71c2aad526d0439eea)
Reviewed-on: https://gerrit.libreoffice.org/22889
Tested-by: Jenkins <ci at libreoffice.org>
diff --git a/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx b/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx
index 9d75134a..4c98a19 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>
@@ -381,6 +382,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