You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by al...@apache.org on 2012/01/30 14:56:49 UTC

svn commit: r1237656 - /incubator/ooo/trunk/main/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx

Author: alg
Date: Mon Jan 30 13:56:49 2012
New Revision: 1237656

URL: http://svn.apache.org/viewvc?rev=1237656&view=rev
Log:
#118853# added square pixel size limit to conversion of TransparencePrimitive2D to Metafile action

Modified:
    incubator/ooo/trunk/main/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx

Modified: incubator/ooo/trunk/main/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx?rev=1237656&r1=1237655&r2=1237656&view=diff
==============================================================================
--- incubator/ooo/trunk/main/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx (original)
+++ incubator/ooo/trunk/main/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx Mon Jan 30 13:56:49 2012
@@ -1904,9 +1904,20 @@ namespace drawinglayer
 			                    (sal_Int32)floor(aViewRange.getMinX()), (sal_Int32)floor(aViewRange.getMinY()), 
 			                    (sal_Int32)ceil(aViewRange.getMaxX()), (sal_Int32)ceil(aViewRange.getMaxY()));
 		                    const Rectangle aRectPixel(mpOutputDevice->LogicToPixel(aRectLogic));
-                            const Size aSizePixel(aRectPixel.GetSize());
+                            Size aSizePixel(aRectPixel.GetSize());
                     		const Point aEmptyPoint;
                             VirtualDevice aBufferDevice;
+                            const sal_uInt32 nMaxQuadratPixels(500000);
+                            const sal_uInt32 nViewVisibleArea(aSizePixel.getWidth() * aSizePixel.getHeight());
+                            double fReduceFactor(1.0);
+
+                            if(nViewVisibleArea > nMaxQuadratPixels)
+                            {
+                                // reduce render size
+                                fReduceFactor = sqrt((double)nMaxQuadratPixels / (double)nViewVisibleArea);
+                                aSizePixel = Size(basegfx::fround((double)aSizePixel.getWidth() * fReduceFactor),
+                                    basegfx::fround((double)aSizePixel.getHeight() * fReduceFactor));
+                            }
 
                             if(aBufferDevice.SetOutputSizePixel(aSizePixel))
                             {
@@ -1930,6 +1941,12 @@ namespace drawinglayer
                                     aViewTransform.scale(fDPIXChange, fDPIYChange);
                                 }
 
+                                // also take scaling from Size reduction into acount
+                                if(!basegfx::fTools::equal(fReduceFactor, 1.0))
+                                {
+                                    aViewTransform.scale(fReduceFactor, fReduceFactor);
+                                }
+
                                 // create view information and pixel renderer. Reuse known ViewInformation
 								// except new transformation and range
                                 const geometry::ViewInformation2D aViewInfo(