drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx    |    2 
 drawinglayer/source/primitive2d/graphicprimitive2d.cxx        |    2 
 drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx  |    2 
 drawinglayer/source/processor2d/cairopixelprocessor2d.cxx     |    2 
 include/drawinglayer/primitive2d/graphicprimitivehelper2d.hxx |    2 
 solenv/clang-format/excludelist                               |    2 
 svx/source/sdr/contact/viewobjectcontact.cxx                  |   24 +++++++++-
 7 files changed, 29 insertions(+), 7 deletions(-)

New commits:
commit 1bfebb926df434618a79672f3cc30c96cba89021
Author:     Armin Le Grand (allotropia) <armin.le.grand.ext...@allotropia.de>
AuthorDate: Tue Jul 9 11:01:47 2024 +0200
Commit:     Armin Le Grand <armin.le.gr...@me.com>
CommitDate: Wed Jul 10 10:50:31 2024 +0200

    CairoSDPR: Handle FillGraphicPrimitive2D better
    
    Avoid decomposition of it in AnimatedExtractingProcessor2D
    by handling there directly. Goal is to find/extract animation
    primitives, so only do something when the contained Graphic
    is active
    
    Change-Id: I1d168428ddbaaac2c9d5fde7b26be380ba442c30
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170203
    Tested-by: Jenkins
    Reviewed-by: Armin Le Grand <armin.le.gr...@me.com>

diff --git a/drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx 
b/drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx
index a553687e7787..293f3738fa1b 100644
--- a/drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx
@@ -24,7 +24,7 @@
 #include <basegfx/matrix/b2dhommatrixtools.hxx>
 #include <drawinglayer/primitive2d/transformprimitive2d.hxx>
 #include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
-#include <primitive2d/graphicprimitivehelper2d.hxx>
+#include <drawinglayer/primitive2d/graphicprimitivehelper2d.hxx>
 #include <utility>
 #include <vcl/graph.hxx>
 
diff --git a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx 
b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
index 8219d25d59bc..0f228c528a0e 100644
--- a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
@@ -24,7 +24,7 @@
 #include <drawinglayer/primitive2d/graphicprimitive2d.hxx>
 #include <primitive2d/cropprimitive2d.hxx>
 #include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
-#include <primitive2d/graphicprimitivehelper2d.hxx>
+#include <drawinglayer/primitive2d/graphicprimitivehelper2d.hxx>
 #include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
 #include <basegfx/matrix/b2dhommatrixtools.hxx>
 #include <utility>
diff --git a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx 
b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
index d756e6e3b74f..f59679e99817 100644
--- a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
+++ b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
@@ -21,7 +21,7 @@
 
 #include <algorithm>
 
-#include <primitive2d/graphicprimitivehelper2d.hxx>
+#include <drawinglayer/primitive2d/graphicprimitivehelper2d.hxx>
 #include <drawinglayer/animation/animationtiming.hxx>
 #include <drawinglayer/primitive2d/bitmapprimitive2d.hxx>
 #include <drawinglayer/primitive2d/animatedprimitive2d.hxx>
diff --git a/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx 
b/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx
index 28ccb517d32a..b29ca97eac4b 100644
--- a/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx
@@ -1210,7 +1210,7 @@ void CairoPixelProcessor2D::processInvertPrimitive2D(
         {
             // get mem locations
             unsigned char* pDstData(pDstDataRoot + (nDstStride * y));
-            unsigned char* pSrcData(pSrcDataRoot + (nSrcStride * (y + 
nSrcOffY) + (nSrcOffX * 4)));
+            unsigned char* pSrcData(pSrcDataRoot + (nSrcStride * (y + 
nSrcOffY)) + (nSrcOffX * 4));
 
             for (sal_uInt32 x(0); x < nDstWidth; ++x)
             {
diff --git a/drawinglayer/inc/primitive2d/graphicprimitivehelper2d.hxx 
b/include/drawinglayer/primitive2d/graphicprimitivehelper2d.hxx
similarity index 97%
rename from drawinglayer/inc/primitive2d/graphicprimitivehelper2d.hxx
rename to include/drawinglayer/primitive2d/graphicprimitivehelper2d.hxx
index cecb1d8f1564..6aa8ef5191ce 100644
--- a/drawinglayer/inc/primitive2d/graphicprimitivehelper2d.hxx
+++ b/include/drawinglayer/primitive2d/graphicprimitivehelper2d.hxx
@@ -34,7 +34,7 @@ namespace drawinglayer::primitive2d
             Bitmaps (with the sub-categories animated bitmap, and SVG),
             and Metafiles.
          */
-        void create2DDecompositionOfGraphic(
+        void DRAWINGLAYER_DLLPUBLIC create2DDecompositionOfGraphic(
             Primitive2DContainer& rContainer,
             const Graphic& rGraphic,
             const basegfx::B2DHomMatrix& rTransform);
diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist
index 05b7c938fd3c..1764d176f505 100644
--- a/solenv/clang-format/excludelist
+++ b/solenv/clang-format/excludelist
@@ -3224,7 +3224,6 @@ desktop/win32/source/loader.hxx
 desktop/win32/source/unoinfo.cxx
 drawinglayer/inc/emfplushelper.hxx
 drawinglayer/inc/primitive2d/cropprimitive2d.hxx
-drawinglayer/inc/primitive2d/graphicprimitivehelper2d.hxx
 drawinglayer/inc/primitive2d/textlineprimitive2d.hxx
 drawinglayer/inc/primitive2d/textstrikeoutprimitive2d.hxx
 drawinglayer/inc/primitive2d/wallpaperprimitive2d.hxx
@@ -5055,6 +5054,7 @@ include/drawinglayer/attribute/sdrobjectattribute3d.hxx
 include/drawinglayer/attribute/sdrsceneattribute3d.hxx
 include/drawinglayer/attribute/sdrshadowattribute.hxx
 include/drawinglayer/geometry/viewinformation3d.hxx
+include/drawinglayer/primitive2d/graphicprimitivehelper2d.hxx
 include/drawinglayer/primitive2d/discretebitmapprimitive2d.hxx
 include/drawinglayer/primitive2d/discreteshadowprimitive2d.hxx
 include/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx
diff --git a/svx/source/sdr/contact/viewobjectcontact.cxx 
b/svx/source/sdr/contact/viewobjectcontact.cxx
index 03d6eb4bd10c..fcac2d021a81 100644
--- a/svx/source/sdr/contact/viewobjectcontact.cxx
+++ b/svx/source/sdr/contact/viewobjectcontact.cxx
@@ -26,6 +26,8 @@
 #include <basegfx/color/bcolor.hxx>
 #include <drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx>
 #include <drawinglayer/primitive2d/animatedprimitive2d.hxx>
+#include <drawinglayer/primitive2d/fillgraphicprimitive2d.hxx>
+#include <drawinglayer/primitive2d/graphicprimitivehelper2d.hxx>
 #include <drawinglayer/processor2d/baseprocessor2d.hxx>
 #include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
 #include <drawinglayer/primitive2d/transformprimitive2d.hxx>
@@ -109,6 +111,27 @@ void 
AnimatedExtractingProcessor2D::processBasePrimitive2D(const drawinglayer::p
             break;
         }
 
+        // CairoSDPR: handle FillGraphicPrimitive2D to avoid expensive 
decompose,
+        // this also activates that tiled stuff gets *animated*. If that is not
+        // wanted this primitive might just be ignored
+        case PRIMITIVE2D_ID_FILLGRAPHICPRIMITIVE2D:
+        {
+            const drawinglayer::primitive2d::FillGraphicPrimitive2D& rFill(
+                static_cast<const 
drawinglayer::primitive2d::FillGraphicPrimitive2D&>(rCandidate));
+            const drawinglayer::attribute::FillGraphicAttribute& 
rAttribute(rFill.getFillGraphic());
+            const Graphic& rGraphic(rAttribute.getGraphic());
+
+            if(rGraphic.IsAnimated())
+            {
+                // create temporary GraphicPrimitive to recursively extract 
evtl. animation
+                drawinglayer::primitive2d::Primitive2DContainer aContainer;
+                
drawinglayer::primitive2d::create2DDecompositionOfGraphic(aContainer, rGraphic, 
rFill.getTransformation());
+                process(aContainer);
+            }
+
+            break;
+        }
+
         // decompose animated gifs where SdrGrafPrimitive2D produces a 
GraphicPrimitive2D
         // which then produces the animation infos (all when used/needed)
         case PRIMITIVE2D_ID_SDRGRAFPRIMITIVE2D :
@@ -127,7 +150,6 @@ void 
AnimatedExtractingProcessor2D::processBasePrimitive2D(const drawinglayer::p
         // #121194# With Graphic as Bitmap FillStyle, also check
         // for primitives filled with animated graphics
         case PRIMITIVE2D_ID_POLYPOLYGONGRAPHICPRIMITIVE2D:
-        case PRIMITIVE2D_ID_FILLGRAPHICPRIMITIVE2D:
         case PRIMITIVE2D_ID_TRANSFORMPRIMITIVE2D:
 
         // decompose evtl. animated text contained in MaskPrimitive2D

Reply via email to