[Libreoffice-commits] core.git: 2 commits - vcl/opengl vcl/source vcl/workben
Michael Meeks
michael.meeks at collabora.com
Sat Jan 9 12:28:54 PST 2016
vcl/opengl/gdiimpl.cxx | 13 ++++++++++++-
vcl/source/outdev/rect.cxx | 2 ++
vcl/workben/vcldemo.cxx | 18 ++++++++++++++----
3 files changed, 28 insertions(+), 5 deletions(-)
New commits:
commit 60790935cc143de49b732e93b6fb923b7669530b
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Sat Jan 9 12:13:15 2016 +0000
tdf#96657 - vcl opengl: implement invert: Track Frame.
Change-Id: I422ea8cfb8a81cca36203d496b92e15ea5b449d2
Reviewed-on: https://gerrit.libreoffice.org/21291
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index e00352f..d01d66b 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -576,6 +576,7 @@ bool OpenGLSalGraphicsImpl::UseInvert( SalInvert nFlags )
if( ( nFlags & SAL_INVERT_50 ) ||
( nFlags & SAL_INVERT_TRACKFRAME ) )
{
+ // FIXME: Trackframe really should be 2 pix. on/off stipple.
if( !UseInvert50() )
return false;
mpProgram->SetBlendMode( GL_ONE_MINUS_DST_COLOR,
@@ -1757,7 +1758,17 @@ void OpenGLSalGraphicsImpl::invert(
PreDraw();
if( UseInvert( nFlags ) )
- DrawRect( nX, nY, nWidth, nHeight );
+ {
+ if( nFlags & SAL_INVERT_TRACKFRAME )
+ { // FIXME: could be more efficient.
+ DrawRect( nX, nY, nWidth, 1 );
+ DrawRect( nX, nY + nHeight, nWidth, 1 );
+ DrawRect( nX, nY, 1, nHeight );
+ DrawRect( nX + nWidth, nY, 1, nHeight );
+ }
+ else
+ DrawRect( nX, nY, nWidth, nHeight );
+ }
PostDraw();
}
commit 7ede462d8a2a05eccede6d47c2f25649858c959d
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Sat Jan 9 12:12:15 2016 +0000
tdf#96657 - vcldemo - implement invert: Track Frame rendering test.
Change-Id: I07f4622945cf5787102317cfa38875c67104f265
Reviewed-on: https://gerrit.libreoffice.org/21290
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
diff --git a/vcl/source/outdev/rect.cxx b/vcl/source/outdev/rect.cxx
index 1dc728a..056eb44 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 40a37fd..e3016b5 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);
}
}
};
More information about the Libreoffice-commits
mailing list