summaryrefslogtreecommitdiff
path: root/canvas
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-06-19 16:03:21 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-06-20 07:51:22 +0200
commit19f3b88c1ee2ab546a92c28f155f4d65e0c464df (patch)
treef12119740ba1d7245b51e03364a490575a8f830a /canvas
parent6ee9f2c188290ba8a8bc6d435f645b31a05783ea (diff)
loplugin:oncevar chart2
Change-Id: I2dd0939db440b5357225395e88680dd0b0fdbf43 Reviewed-on: https://gerrit.libreoffice.org/38970 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'canvas')
-rw-r--r--canvas/source/vcl/spritehelper.cxx55
1 files changed, 24 insertions, 31 deletions
diff --git a/canvas/source/vcl/spritehelper.cxx b/canvas/source/vcl/spritehelper.cxx
index ee70b21425aa..d45adc84cd87 100644
--- a/canvas/source/vcl/spritehelper.cxx
+++ b/canvas/source/vcl/spritehelper.cxx
@@ -226,10 +226,6 @@ namespace vclcanvas
// scales.
if( !!(*maContent) )
{
- // when true, fast path for slide transition has
- // already redrawn the sprite.
- bool bSpriteRedrawn( false );
-
rTargetSurface.Push( PushFlags::CLIPREGION );
// apply clip (if any)
@@ -260,35 +256,32 @@ namespace vclcanvas
}
}
- if( !bSpriteRedrawn )
+ if( ::rtl::math::approxEqual(fAlpha, 1.0) )
{
- if( ::rtl::math::approxEqual(fAlpha, 1.0) )
- {
- // no alpha modulation -> just copy to output
- if( maContent->IsTransparent() )
- rTargetSurface.DrawBitmapEx( aOutPos, aOutputSize, *maContent );
- else
- rTargetSurface.DrawBitmap( aOutPos, aOutputSize, maContent->GetBitmap() );
- }
+ // no alpha modulation -> just copy to output
+ if( maContent->IsTransparent() )
+ rTargetSurface.DrawBitmapEx( aOutPos, aOutputSize, *maContent );
else
- {
- // TODO(P3): Switch to OutputDevice::DrawTransparent()
- // here
-
- // draw semi-transparent
- sal_uInt8 nColor( static_cast<sal_uInt8>( ::basegfx::fround( 255.0*(1.0 - fAlpha) + .5) ) );
- AlphaMask aAlpha( maContent->GetSizePixel(),
- &nColor );
-
- // mask out fully transparent areas
- if( maContent->IsTransparent() )
- aAlpha.Replace( maContent->GetMask(), 255 );
-
- // alpha-blend to output
- rTargetSurface.DrawBitmapEx( aOutPos, aOutputSize,
- BitmapEx( maContent->GetBitmap(),
- aAlpha ) );
- }
+ rTargetSurface.DrawBitmap( aOutPos, aOutputSize, maContent->GetBitmap() );
+ }
+ else
+ {
+ // TODO(P3): Switch to OutputDevice::DrawTransparent()
+ // here
+
+ // draw semi-transparent
+ sal_uInt8 nColor( static_cast<sal_uInt8>( ::basegfx::fround( 255.0*(1.0 - fAlpha) + .5) ) );
+ AlphaMask aAlpha( maContent->GetSizePixel(),
+ &nColor );
+
+ // mask out fully transparent areas
+ if( maContent->IsTransparent() )
+ aAlpha.Replace( maContent->GetMask(), 255 );
+
+ // alpha-blend to output
+ rTargetSurface.DrawBitmapEx( aOutPos, aOutputSize,
+ BitmapEx( maContent->GetBitmap(),
+ aAlpha ) );
}
rTargetSurface.Pop();