summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2016-01-09 12:12:15 +0000
committerMichael Meeks <michael.meeks@collabora.com>2016-01-09 20:28:31 +0000
commit7ede462d8a2a05eccede6d47c2f25649858c959d (patch)
tree25ec10b3adfd52124fd08591289f087637220dde
parent35fefeaba8faf6c83833b91cb605de576af9e457 (diff)
tdf#96657 - vcldemo - implement invert: Track Frame rendering test.
Change-Id: I07f4622945cf5787102317cfa38875c67104f265 Reviewed-on: https://gerrit.libreoffice.org/21290 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
-rw-r--r--vcl/source/outdev/rect.cxx2
-rw-r--r--vcl/workben/vcldemo.cxx18
2 files changed, 16 insertions, 4 deletions
diff --git a/vcl/source/outdev/rect.cxx b/vcl/source/outdev/rect.cxx
index 1dc728a64cdc..056eb443407a 100644
--- a/vcl/source/outdev/rect.cxx
+++ b/vcl/source/outdev/rect.cxx
@@ -159,6 +159,8 @@ void OutputDevice::Invert( const Rectangle& rRect, InvertFlags nFlags )
nSalFlags |= SAL_INVERT_HIGHLIGHT;
if ( nFlags & InvertFlags::N50 )
nSalFlags |= SAL_INVERT_50;
+ if ( nFlags == (InvertFlags) 0xffff ) // vcldemo trackframe test
+ nSalFlags = SAL_INVERT_TRACKFRAME;
mpGraphics->Invert( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight(), nSalFlags, this );
}
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index 40a37fd86146..e3016b59f432 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -570,6 +570,16 @@ public:
struct DrawEllipse : public RegionRenderer
{
RENDER_DETAILS(ellipse,KEY_E,500)
+ void doInvert(OutputDevice &rDev, const Rectangle &r,
+ InvertFlags nFlags)
+ {
+ rDev.Invert(r, nFlags);
+ if (r.GetWidth() > 10 && r.GetHeight() > 10)
+ {
+ Rectangle aSmall(r.Center()-Point(4,4), Size(8,8));
+ rDev.Invert(aSmall,nFlags);
+ }
+ }
virtual void RenderRegion(OutputDevice &rDev, Rectangle r,
const RenderContext &rCtx) override
{
@@ -580,10 +590,10 @@ public:
if (rCtx.meStyle == RENDER_EXPANDED)
{
auto aRegions = partition(rCtx, 2, 2);
- rDev.Invert(aRegions[0]);
- rDev.Invert(aRegions[1], InvertFlags::N50);
- rDev.Invert(aRegions[2], InvertFlags::Highlight);
- rDev.Invert(aRegions[3], (InvertFlags)0xffff);
+ doInvert(rDev, aRegions[0], InvertFlags::NONE);
+ doInvert(rDev, aRegions[1], InvertFlags::N50);
+ doInvert(rDev, aRegions[2], InvertFlags::Highlight);
+ doInvert(rDev, aRegions[3], (InvertFlags)0xffff);
}
}
};