[Libreoffice-commits] core.git: Branch 'feature/opengl-vcl2' - vcl/workben

Michael Meeks michael.meeks at collabora.com
Tue Nov 18 08:46:53 PST 2014


 vcl/workben/vcldemo.cxx |   31 +++++++++++--------------------
 1 file changed, 11 insertions(+), 20 deletions(-)

New commits:
commit 0c39c360b49a406bc960bf395a007f93568e37e5
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Tue Nov 18 16:47:36 2014 +0000

    vcldemo: render more small scaled page-border alikes
    
    Change-Id: I2605175e7ee66d3da5e41497baa4178074830e99

diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index 336c85d..a70de2d 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -460,28 +460,19 @@ public:
             aBlockColor.Erase(COL_RED);
             BitmapEx aShadowStretch = BitmapEx(aBlockColor, aAlphaMask);
 
-#ifdef DEBUG
-            { // before - the pristine <n>x1 image
-                SvFileStream aStream("/tmp/myshadow.png", STREAM_WRITE);
-                vcl::PNGWriter aWriter(aShadowStretch);
-                aWriter.Write(aStream);
-            }
-#endif
+            Point aRenderPt(r.TopLeft());
+
+            long aSizes[] = { 200, 100, 200, 100, 50, 5, 2 };
+
             // and yes - we really do this in the page border rendering code ...
-            aShadowStretch.Scale(Size(aShadowStretch.GetSizePixel().Width(), 50),
-                                   BMP_SCALE_FAST);
-            aShadowStretch.Scale(Size(aShadowStretch.GetSizePixel().Width(), 800),
-                                   BMP_SCALE_FAST);
-#ifdef DEBUG
-            { // after the corrupted image full of fluff ...
-                SvFileStream aStream("/tmp/myshadow-50.png", STREAM_WRITE);
-                vcl::PNGWriter aWriter(aShadowStretch);
-                aWriter.Write(aStream);
+            for (size_t i = 0; i < SAL_N_ELEMENTS(aSizes); i++)
+            {
+                aShadowStretch.Scale(Size(aShadowStretch.GetSizePixel().Width(), aSizes[i]),
+                                     BMP_SCALE_FAST);
+
+                rDev.DrawBitmapEx(aRenderPt, aShadowStretch);
+                aRenderPt.Move(aShadowStretch.GetSizePixel().Width() + 4, 0);
             }
-#endif
-            Point aRenderPt(r.Center());
-            aRenderPt.Move(-nSlice-1, 0);
-            rDev.DrawBitmapEx(aRenderPt, aShadowStretch);
 
             AlphaMask aWholeMask(aPageShadowMask.GetBitmap());
             aBlockColor = Bitmap(aPageShadowMask.GetSizePixel(), 24);


More information about the Libreoffice-commits mailing list