Return-Path: X-Original-To: apmail-openoffice-commits-archive@www.apache.org Delivered-To: apmail-openoffice-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0036D11BB6 for ; Thu, 3 Jul 2014 15:49:32 +0000 (UTC) Received: (qmail 65811 invoked by uid 500); 3 Jul 2014 15:49:31 -0000 Delivered-To: apmail-openoffice-commits-archive@openoffice.apache.org Received: (qmail 65766 invoked by uid 500); 3 Jul 2014 15:49:31 -0000 Mailing-List: contact commits-help@openoffice.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openoffice.apache.org Delivered-To: mailing list commits@openoffice.apache.org Received: (qmail 65756 invoked by uid 99); 3 Jul 2014 15:49:31 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Jul 2014 15:49:31 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Jul 2014 15:49:30 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id EA6C82388860; Thu, 3 Jul 2014 15:49:09 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@openoffice.apache.org From: alg@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140703154909.EA6C82388860@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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); } }