summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2014-11-08 21:41:13 +0000
committerMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-11-10 07:59:42 +0100
commit60c506a97fa850baba1fafdfc35af73808b03060 (patch)
tree81c2b085c14cd7c9f89978e3730ab2354e7ad8be /vcl
parent2b69366bf8bd0d0b6a3bcfbf58c1b16edfc1a746 (diff)
vcldemo: add a virtualdevice test.
Change-Id: I8ff8c74e13a128d778b487ec2818820df9d5058a
Diffstat (limited to 'vcl')
-rw-r--r--vcl/workben/vcldemo.cxx24
1 files changed, 19 insertions, 5 deletions
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index 9b314dfcc2dd..cae3fb0b7a03 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -22,6 +22,7 @@
#include <vcl/svapp.hxx>
#include <vcl/pngread.hxx>
#include <vcl/wrkwin.hxx>
+#include <vcl/virdev.hxx>
#include <vcl/graphicfilter.hxx>
#if 0
@@ -70,12 +71,12 @@ public:
maIntroBW.Filter( BMP_FILTER_EMBOSS_GREY );
}
- void drawToDevice(OutputDevice &r);
+ void drawToDevice(OutputDevice &r, bool bVdev);
virtual void Paint( const Rectangle& rRect ) SAL_OVERRIDE
{
fprintf(stderr, "DemoWin::Paint(%ld,%ld,%ld,%ld)\n", rRect.getX(), rRect.getY(), rRect.getWidth(), rRect.getHeight());
- drawToDevice(getOutDev());
+ drawToDevice(getOutDev(), false);
}
std::vector<Rectangle> partitionAndClear(OutputDevice &rDev,
@@ -233,8 +234,19 @@ public:
rDev.DrawPolyPolygon(aPolyPoly);
#endif
}
- void fetchDrawBitmap(OutputDevice &rDev, Rectangle r)
+ void drawToVirtualDevice(OutputDevice &rDev, Rectangle r)
+ {
+ VirtualDevice aNested;
+ aNested.SetOutputSize(r.GetSize());
+ Rectangle aWhole(Point(0,0), r.GetSize());
+ // mini me
+ drawToDevice(aNested, true);
+
+ Bitmap aBitmap(aNested.GetBitmap(Point(0,0),aWhole.GetSize()));
+ rDev.DrawBitmap(r.TopLeft(), aBitmap);
+ }
+ void fetchDrawBitmap(OutputDevice &rDev, Rectangle r)
{
// FIXME: should work ...
Bitmap aBitmap(GetBitmap(Point(0,0),rDev.GetOutputSizePixel()));
@@ -282,7 +294,7 @@ std::vector<Rectangle> DemoWin::partitionAndClear(OutputDevice &rDev, int nX, in
return aRegions;
}
-void DemoWin::drawToDevice(OutputDevice &rDev)
+void DemoWin::drawToDevice(OutputDevice &rDev, bool bVdev)
{
drawBackground(rDev);
@@ -297,8 +309,10 @@ void DemoWin::drawToDevice(OutputDevice &rDev)
drawBitmap(rDev, aRegions[6]);
drawGradient(rDev, aRegions[7]);
drawPolyPolgons(rDev, aRegions[8]);
+ if (!bVdev)
+ drawToVirtualDevice(rDev, aRegions[9]);
// last - thumbnail all the above
- fetchDrawBitmap(rDev, aRegions[9]);
+ fetchDrawBitmap(rDev, aRegions[10]);
}
class DemoApp : public Application