openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1607682 - in /openoffice/trunk/main/svgio: inc/svgio/svgreader/svgclippathnode.hxx inc/svgio/svgreader/svgmasknode.hxx source/svgreader/svgclippathnode.cxx source/svgreader/svgmasknode.cxx source/svgreader/svgstyleattributes.cxx
Date Thu, 03 Jul 2014 15:49:09 GMT
Author: alg
Date: Thu Jul  3 15:49:09 2014
New Revision: 1607682

URL: http://svn.apache.org/r1607682
Log:
i124852 Corrected mask and clip polygons for userSpaceOnUse

Modified:
    openoffice/trunk/main/svgio/inc/svgio/svgreader/svgclippathnode.hxx
    openoffice/trunk/main/svgio/inc/svgio/svgreader/svgmasknode.hxx
    openoffice/trunk/main/svgio/source/svgreader/svgclippathnode.cxx
    openoffice/trunk/main/svgio/source/svgreader/svgmasknode.cxx
    openoffice/trunk/main/svgio/source/svgreader/svgstyleattributes.cxx

Modified: openoffice/trunk/main/svgio/inc/svgio/svgreader/svgclippathnode.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svgio/inc/svgio/svgreader/svgclippathnode.hxx?rev=1607682&r1=1607681&r2=1607682&view=diff
==============================================================================
--- openoffice/trunk/main/svgio/inc/svgio/svgreader/svgclippathnode.hxx (original)
+++ openoffice/trunk/main/svgio/inc/svgio/svgreader/svgclippathnode.hxx Thu Jul  3 15:49:09
2014
@@ -52,8 +52,10 @@ namespace svgio
             virtual void parseAttribute(const rtl::OUString& rTokenName, SVGToken aSVGToken,
const rtl::OUString& aContent);
             virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DSequence&
rTarget, bool bReferenced) const;
 
-            /// apply contained clipPath to given geometry
-            void apply(drawinglayer::primitive2d::Primitive2DSequence& rTarget) const;
+            /// apply contained clipPath to given geometry #i124852# transform may be needed
+            void apply(
+                drawinglayer::primitive2d::Primitive2DSequence& rTarget, 
+                const basegfx::B2DHomMatrix* pTransform) const;
 
             /// clipPathUnits content
             SvgUnits getClipPathUnits() const { return maClipPathUnits; }

Modified: openoffice/trunk/main/svgio/inc/svgio/svgreader/svgmasknode.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svgio/inc/svgio/svgreader/svgmasknode.hxx?rev=1607682&r1=1607681&r2=1607682&view=diff
==============================================================================
--- openoffice/trunk/main/svgio/inc/svgio/svgreader/svgmasknode.hxx (original)
+++ openoffice/trunk/main/svgio/inc/svgio/svgreader/svgmasknode.hxx Thu Jul  3 15:49:09 2014
@@ -57,8 +57,10 @@ namespace svgio
             virtual void parseAttribute(const rtl::OUString& rTokenName, SVGToken aSVGToken,
const rtl::OUString& aContent);
             virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DSequence&
rTarget, bool bReferenced) const;
 
-            /// apply contained clipPath to given geometry
-            void apply(drawinglayer::primitive2d::Primitive2DSequence& rTarget) const;
+            /// apply contained clipPath to given geometry #i124852# transform may be needed
+            void apply(
+                drawinglayer::primitive2d::Primitive2DSequence& rTarget, 
+                const basegfx::B2DHomMatrix* pTransform) const;
 
             /// x content, set if found in current context
             const SvgNumber& getX() const { return maX; }

Modified: openoffice/trunk/main/svgio/source/svgreader/svgclippathnode.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svgio/source/svgreader/svgclippathnode.cxx?rev=1607682&r1=1607681&r2=1607682&view=diff
==============================================================================
--- openoffice/trunk/main/svgio/source/svgreader/svgclippathnode.cxx (original)
+++ openoffice/trunk/main/svgio/source/svgreader/svgclippathnode.cxx Thu Jul  3 15:49:09 2014
@@ -132,7 +132,9 @@ namespace svgio
             }
         }
 
-        void SvgClipPathNode::apply(drawinglayer::primitive2d::Primitive2DSequence& rContent)
const
+        void SvgClipPathNode::apply(
+            drawinglayer::primitive2d::Primitive2DSequence& rContent,
+            const basegfx::B2DHomMatrix* pTransform) const
         {
             if(rContent.hasElements() && Display_none != getDisplay())
             {
@@ -179,6 +181,14 @@ namespace svgio
                                 aContentRange.getRange(),
                                 aContentRange.getMinimum()));
                     }
+                    else // userSpaceOnUse
+                    {
+                        // #i124852#
+                        if(pTransform)
+                        {
+                            aClipPolyPolygon.transform(*pTransform);
+                        }
+                    }
 
                     // #124313# try to avoid creating an embedding to a MaskPrimitive2D if
                     // possible; MaskPrimitive2D processing is potentially expensive

Modified: openoffice/trunk/main/svgio/source/svgreader/svgmasknode.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svgio/source/svgreader/svgmasknode.cxx?rev=1607682&r1=1607681&r2=1607682&view=diff
==============================================================================
--- openoffice/trunk/main/svgio/source/svgreader/svgmasknode.cxx (original)
+++ openoffice/trunk/main/svgio/source/svgreader/svgmasknode.cxx Thu Jul  3 15:49:09 2014
@@ -197,7 +197,9 @@ namespace svgio
             }
         }
 
-        void SvgMaskNode::apply(drawinglayer::primitive2d::Primitive2DSequence& rTarget)
const
+        void SvgMaskNode::apply(
+            drawinglayer::primitive2d::Primitive2DSequence& rTarget,
+            const basegfx::B2DHomMatrix* pTransform) const
         {
             if(rTarget.hasElements() && Display_none != getDisplay())
             {
@@ -259,6 +261,19 @@ namespace svgio
 
                             aMaskTarget = drawinglayer::primitive2d::Primitive2DSequence(&xTransform,
1);
                         }
+                        else // userSpaceOnUse
+                        {
+                            // #i124852#
+                            if(pTransform)
+                            {
+                                const drawinglayer::primitive2d::Primitive2DReference xTransform(
+                                    new drawinglayer::primitive2d::TransformPrimitive2D(
+                                        *pTransform,
+                                        aMaskTarget));
+
+                                aMaskTarget = drawinglayer::primitive2d::Primitive2DSequence(&xTransform,
1);
+                            }
+                        }
 
                         // embed content to a ModifiedColorPrimitive2D since the definitions
                         // how content is used as alpha is special for Svg

Modified: openoffice/trunk/main/svgio/source/svgreader/svgstyleattributes.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svgio/source/svgreader/svgstyleattributes.cxx?rev=1607682&r1=1607681&r2=1607682&view=diff
==============================================================================
--- openoffice/trunk/main/svgio/source/svgreader/svgstyleattributes.cxx (original)
+++ openoffice/trunk/main/svgio/source/svgreader/svgstyleattributes.cxx Thu Jul  3 15:49:09
2014
@@ -1130,7 +1130,8 @@ namespace svgio
 
                     if(mpClip)
                     {
-                        mpClip->apply(aSource);
+                        // #i124852# transform may be needed when userSpaceOnUse
+                        mpClip->apply(aSource, pTransform);
                     }
                 }
 
@@ -1143,7 +1144,8 @@ namespace svgio
 
                         if(mpMask)
                         {
-                            mpMask->apply(aSource);
+                            // #i124852# transform may be needed when userSpaceOnUse
+                            mpMask->apply(aSource, pTransform);
                         }
                     }
 



Mime
View raw message