summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2014-11-18 16:47:36 +0000
committerMichael Meeks <michael.meeks@collabora.com>2014-11-18 16:47:36 +0000
commit0c39c360b49a406bc960bf395a007f93568e37e5 (patch)
tree0b9ad4a223da1e3b64943f177d0d1052972fe2f2
parent9b18be272124c0157eea1b24d396e03b2135fffd (diff)
vcldemo: render more small scaled page-border alikes
Change-Id: I2605175e7ee66d3da5e41497baa4178074830e99
-rw-r--r--vcl/workben/vcldemo.cxx31
1 files changed, 11 insertions, 20 deletions
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index 336c85ddccb5..a70de2d556f3 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);