summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2014-11-11 21:25:07 +0100
committerJan Holesovsky <kendy@collabora.com>2014-11-11 21:46:54 +0100
commitd87b163f8dc787d3bbb17d4a0008ef60c61fe6b0 (patch)
treebe662ed3af4d8858b8baadbaa3aaf772e35f057d
parentd9fbaf248ea907428c3a5d0422d0c9a9ce50b907 (diff)
windows opengl: Make sure we don't reach the slow parts of the code.
Change-Id: I2a4d1bd294d1d88651c8556091f5453ef0aa5293
-rw-r--r--vcl/source/outdev/bitmap.cxx13
1 files changed, 8 insertions, 5 deletions
diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx
index 20e6367ac30c..4955b4b91995 100644
--- a/vcl/source/outdev/bitmap.cxx
+++ b/vcl/source/outdev/bitmap.cxx
@@ -20,6 +20,7 @@
#include <vcl/bitmap.hxx>
#include <vcl/bitmapex.hxx>
#include <vcl/bmpacc.hxx>
+#include <vcl/opengl/OpenGLHelper.hxx>
#include <vcl/outdev.hxx>
#include <vcl/virdev.hxx>
#include <vcl/image.hxx>
@@ -32,7 +33,6 @@
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <boost/scoped_array.hpp>
-
void OutputDevice::DrawBitmap( const Point& rDestPt, const Bitmap& rBitmap )
{
const Size aSizePix( rBitmap.GetSizePixel() );
@@ -656,7 +656,6 @@ void OutputDevice::DrawDeviceAlphaBitmap( const Bitmap& rBmp, const AlphaMask& r
if( !aDstRect.Intersection( Rectangle( aOutPt, aOutSz ) ).IsEmpty() )
{
- bool bNativeAlpha = false;
static const char* pDisableNative = getenv( "SAL_DISABLE_NATIVE_ALPHA");
// #i83087# Naturally, system alpha blending cannot work with
// separate alpha VDev
@@ -686,14 +685,18 @@ void OutputDevice::DrawDeviceAlphaBitmap( const Bitmap& rBmp, const AlphaMask& r
};
SalBitmap* pSalSrcBmp = rBmp.ImplGetImpBitmap()->ImplGetSalBitmap();
SalBitmap* pSalAlphaBmp = rAlpha.ImplGetImpBitmap()->ImplGetSalBitmap();
- bNativeAlpha = mpGraphics->DrawAlphaBitmap( aTR, *pSalSrcBmp, *pSalAlphaBmp, this );
+
+ if (mpGraphics->DrawAlphaBitmap( aTR, *pSalSrcBmp, *pSalAlphaBmp, this ))
+ return;
}
+ // we need to make sure OpenGL never reaches this slow code path
+ assert(!OpenGLHelper::isVCLOpenGLEnabled());
+
VirtualDevice* pOldVDev = mpAlphaVDev;
Rectangle aBmpRect( Point(), rBmp.GetSizePixel() );
- if( !bNativeAlpha
- && !aBmpRect.Intersection( Rectangle( rSrcPtPixel, rSrcSizePixel ) ).IsEmpty() )
+ if (!aBmpRect.Intersection(Rectangle(rSrcPtPixel, rSrcSizePixel)).IsEmpty())
{
// The scaling in this code path produces really ugly results - it
// does the most trivial scaling with no smoothing.