Kaydet (Commit) 7ede462d authored tarafından Michael Meeks's avatar Michael Meeks

tdf#96657 - vcldemo - implement invert: Track Frame rendering test.

Change-Id: I07f4622945cf5787102317cfa38875c67104f265
Reviewed-on: https://gerrit.libreoffice.org/21290Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMichael Meeks <michael.meeks@collabora.com>
üst 35fefeab
...@@ -159,6 +159,8 @@ void OutputDevice::Invert( const Rectangle& rRect, InvertFlags nFlags ) ...@@ -159,6 +159,8 @@ void OutputDevice::Invert( const Rectangle& rRect, InvertFlags nFlags )
nSalFlags |= SAL_INVERT_HIGHLIGHT; nSalFlags |= SAL_INVERT_HIGHLIGHT;
if ( nFlags & InvertFlags::N50 ) if ( nFlags & InvertFlags::N50 )
nSalFlags |= SAL_INVERT_50; 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 ); mpGraphics->Invert( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight(), nSalFlags, this );
} }
......
...@@ -570,6 +570,16 @@ public: ...@@ -570,6 +570,16 @@ public:
struct DrawEllipse : public RegionRenderer struct DrawEllipse : public RegionRenderer
{ {
RENDER_DETAILS(ellipse,KEY_E,500) 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, virtual void RenderRegion(OutputDevice &rDev, Rectangle r,
const RenderContext &rCtx) override const RenderContext &rCtx) override
{ {
...@@ -580,10 +590,10 @@ public: ...@@ -580,10 +590,10 @@ public:
if (rCtx.meStyle == RENDER_EXPANDED) if (rCtx.meStyle == RENDER_EXPANDED)
{ {
auto aRegions = partition(rCtx, 2, 2); auto aRegions = partition(rCtx, 2, 2);
rDev.Invert(aRegions[0]); doInvert(rDev, aRegions[0], InvertFlags::NONE);
rDev.Invert(aRegions[1], InvertFlags::N50); doInvert(rDev, aRegions[1], InvertFlags::N50);
rDev.Invert(aRegions[2], InvertFlags::Highlight); doInvert(rDev, aRegions[2], InvertFlags::Highlight);
rDev.Invert(aRegions[3], (InvertFlags)0xffff); doInvert(rDev, aRegions[3], (InvertFlags)0xffff);
} }
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment