vclmetafileprocessor2d.cxx (5aaf853b) | vclmetafileprocessor2d.cxx (89cebade) |
---|---|
1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 1890 unchanged lines hidden (view full) --- 1899 // refine to tiling here. 1900 1901 basegfx::B2DRange aViewRange(primitive2d::getB2DRangeFromPrimitive2DSequence(rContent, getViewInformation2D())); 1902 aViewRange.transform(maCurrentTransformation); 1903 const Rectangle aRectLogic( 1904 (sal_Int32)floor(aViewRange.getMinX()), (sal_Int32)floor(aViewRange.getMinY()), 1905 (sal_Int32)ceil(aViewRange.getMaxX()), (sal_Int32)ceil(aViewRange.getMaxY())); 1906 const Rectangle aRectPixel(mpOutputDevice->LogicToPixel(aRectLogic)); | 1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 1890 unchanged lines hidden (view full) --- 1899 // refine to tiling here. 1900 1901 basegfx::B2DRange aViewRange(primitive2d::getB2DRangeFromPrimitive2DSequence(rContent, getViewInformation2D())); 1902 aViewRange.transform(maCurrentTransformation); 1903 const Rectangle aRectLogic( 1904 (sal_Int32)floor(aViewRange.getMinX()), (sal_Int32)floor(aViewRange.getMinY()), 1905 (sal_Int32)ceil(aViewRange.getMaxX()), (sal_Int32)ceil(aViewRange.getMaxY())); 1906 const Rectangle aRectPixel(mpOutputDevice->LogicToPixel(aRectLogic)); |
1907 const Size aSizePixel(aRectPixel.GetSize()); | 1907 Size aSizePixel(aRectPixel.GetSize()); |
1908 const Point aEmptyPoint; 1909 VirtualDevice aBufferDevice; | 1908 const Point aEmptyPoint; 1909 VirtualDevice aBufferDevice; |
1910 const sal_uInt32 nMaxQuadratPixels(500000); 1911 const sal_uInt32 nViewVisibleArea(aSizePixel.getWidth() * aSizePixel.getHeight()); 1912 double fReduceFactor(1.0); |
|
1910 | 1913 |
1914 if(nViewVisibleArea > nMaxQuadratPixels) 1915 { 1916 // reduce render size 1917 fReduceFactor = sqrt((double)nMaxQuadratPixels / (double)nViewVisibleArea); 1918 aSizePixel = Size(basegfx::fround((double)aSizePixel.getWidth() * fReduceFactor), 1919 basegfx::fround((double)aSizePixel.getHeight() * fReduceFactor)); 1920 } 1921 |
|
1911 if(aBufferDevice.SetOutputSizePixel(aSizePixel)) 1912 { 1913 // create and set MapModes for target devices 1914 MapMode aNewMapMode(mpOutputDevice->GetMapMode()); 1915 aNewMapMode.SetOrigin(Point(-aRectLogic.Left(), -aRectLogic.Top())); 1916 aBufferDevice.SetMapMode(aNewMapMode); 1917 1918 // prepare view transformation for target renderers --- 6 unchanged lines hidden (view full) --- 1925 const double fDPIXChange((double)aDPIOld.getWidth() / (double)aDPINew.getWidth()); 1926 const double fDPIYChange((double)aDPIOld.getHeight() / (double)aDPINew.getHeight()); 1927 1928 if(!basegfx::fTools::equal(fDPIXChange, 1.0) || !basegfx::fTools::equal(fDPIYChange, 1.0)) 1929 { 1930 aViewTransform.scale(fDPIXChange, fDPIYChange); 1931 } 1932 | 1922 if(aBufferDevice.SetOutputSizePixel(aSizePixel)) 1923 { 1924 // create and set MapModes for target devices 1925 MapMode aNewMapMode(mpOutputDevice->GetMapMode()); 1926 aNewMapMode.SetOrigin(Point(-aRectLogic.Left(), -aRectLogic.Top())); 1927 aBufferDevice.SetMapMode(aNewMapMode); 1928 1929 // prepare view transformation for target renderers --- 6 unchanged lines hidden (view full) --- 1936 const double fDPIXChange((double)aDPIOld.getWidth() / (double)aDPINew.getWidth()); 1937 const double fDPIYChange((double)aDPIOld.getHeight() / (double)aDPINew.getHeight()); 1938 1939 if(!basegfx::fTools::equal(fDPIXChange, 1.0) || !basegfx::fTools::equal(fDPIYChange, 1.0)) 1940 { 1941 aViewTransform.scale(fDPIXChange, fDPIYChange); 1942 } 1943 |
1944 // also take scaling from Size reduction into acount 1945 if(!basegfx::fTools::equal(fReduceFactor, 1.0)) 1946 { 1947 aViewTransform.scale(fReduceFactor, fReduceFactor); 1948 } 1949 |
|
1933 // create view information and pixel renderer. Reuse known ViewInformation 1934 // except new transformation and range 1935 const geometry::ViewInformation2D aViewInfo( 1936 getViewInformation2D().getObjectTransformation(), 1937 aViewTransform, 1938 aViewRange, 1939 getViewInformation2D().getVisualizedPage(), 1940 getViewInformation2D().getViewTime(), --- 99 unchanged lines hidden --- | 1950 // create view information and pixel renderer. Reuse known ViewInformation 1951 // except new transformation and range 1952 const geometry::ViewInformation2D aViewInfo( 1953 getViewInformation2D().getObjectTransformation(), 1954 aViewTransform, 1955 aViewRange, 1956 getViewInformation2D().getVisualizedPage(), 1957 getViewInformation2D().getViewTime(), --- 99 unchanged lines hidden --- |