Kaydet (Commit) 06db1edf authored tarafından Krisztian Pinter's avatar Krisztian Pinter Kaydeden (comit) Caolán McNamara

fdo#38844 Remove XOR rendering code from canvas module

Change-Id: Ie0c6b2950184bd3843baae59eff08a2f4e9e1b9c
Reviewed-on: https://gerrit.libreoffice.org/8715Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 42877b34
...@@ -253,31 +253,6 @@ namespace vclcanvas ...@@ -253,31 +253,6 @@ namespace vclcanvas
// the final sprite output position. // the final sprite output position.
aClipPoly.transform( aTransform ); aClipPoly.transform( aTransform );
#if ! defined WNT && ! defined MACOSX
// non-Windows only - bAtLeastOnePolygon is
// only used in non-WNT code below
// check whether maybe the clip consists
// solely out of rectangular polygons. If this
// is the case, enforce using the triangle
// clip region setup - non-optimized X11
// drivers tend to perform abyssmally on
// XPolygonRegion, which is used internally,
// when filling complex polypolygons.
bool bAtLeastOnePolygon( false );
const sal_Int32 nPolygons( aClipPoly.count() );
for( sal_Int32 i=0; i<nPolygons; ++i )
{
if( !::basegfx::tools::isRectangle(
aClipPoly.getB2DPolygon(i)) )
{
bAtLeastOnePolygon = true;
break;
}
}
#endif
if( mbShowSpriteBounds ) if( mbShowSpriteBounds )
{ {
// Paint green sprite clip area // Paint green sprite clip area
...@@ -287,52 +262,8 @@ namespace vclcanvas ...@@ -287,52 +262,8 @@ namespace vclcanvas
rTargetSurface.DrawPolyPolygon(PolyPolygon(aClipPoly)); // #i76339# rTargetSurface.DrawPolyPolygon(PolyPolygon(aClipPoly)); // #i76339#
} }
#if ! defined WNT && ! defined MACOSX Region aClipRegion( aClipPoly );
// as a matter of fact, this fast path only rTargetSurface.SetClipRegion( aClipRegion );
// performs well for X11 - under Windows, the
// clip via SetTriangleClipRegion is faster.
if( bAtLeastOnePolygon &&
bBufferedUpdate &&
::rtl::math::approxEqual(fAlpha, 1.0) &&
!maContent->IsTransparent() )
{
// fast path for slide transitions
// (buffered, no alpha, no mask (because
// full slide is contained in the sprite))
// XOR bitmap onto backbuffer, clear area
// that should be _visible_ with black,
// XOR bitmap again on top of that -
// result: XOR cancels out where no black
// has been rendered, and yields the
// original bitmap, where black is
// underneath.
rTargetSurface.Push( PUSH_RASTEROP );
rTargetSurface.SetRasterOp( ROP_XOR );
rTargetSurface.DrawBitmap( aOutPos,
aOutputSize,
maContent->GetBitmap() );
rTargetSurface.SetLineColor();
rTargetSurface.SetFillColor( COL_BLACK );
rTargetSurface.SetRasterOp( ROP_0 );
rTargetSurface.DrawPolyPolygon(PolyPolygon(aClipPoly)); // #i76339#
rTargetSurface.SetRasterOp( ROP_XOR );
rTargetSurface.DrawBitmap( aOutPos,
aOutputSize,
maContent->GetBitmap() );
rTargetSurface.Pop();
bSpriteRedrawn = true;
}
else
#endif
{
Region aClipRegion( aClipPoly );
rTargetSurface.SetClipRegion( aClipRegion );
}
} }
} }
......
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