Kaydet (Commit) 4bf97ace authored tarafından Luboš Luňák's avatar Luboš Luňák

do not silently fail if the optimized blend path doesn't do anything

Otherwise e.g. rotated images in Draw may show as empty. Broken in d53103dd.

Change-Id: I0b99b6c39b96f87a78ccb09c9db0a1bfac0f3296
üst 5e62dc99
...@@ -733,7 +733,7 @@ private: ...@@ -733,7 +733,7 @@ private:
} }
public: public:
void blendBitmap( bool blendBitmap(
const BitmapWriteAccess* pDestination, const BitmapWriteAccess* pDestination,
const BitmapReadAccess* pSource, const BitmapReadAccess* pSource,
const BitmapReadAccess* pSourceAlpha, const BitmapReadAccess* pSourceAlpha,
...@@ -754,10 +754,12 @@ public: ...@@ -754,10 +754,12 @@ public:
|| (nSourceFormat == BMP_FORMAT_24BIT_TC_RGB && nDestinationFormat == BMP_FORMAT_32BIT_TC_RGBA)) || (nSourceFormat == BMP_FORMAT_24BIT_TC_RGB && nDestinationFormat == BMP_FORMAT_32BIT_TC_RGBA))
{ {
blendBitmap24(pDestination, pSource, pSourceAlpha, nDstWidth, nDstHeight); blendBitmap24(pDestination, pSource, pSourceAlpha, nDstWidth, nDstHeight);
return true;
} }
} }
} }
} }
return false;
} }
void blendBitmap24( void blendBitmap24(
...@@ -915,10 +917,12 @@ void OutputDevice::DrawDeviceAlphaBitmapSlowPath(const Bitmap& rBitmap, const Al ...@@ -915,10 +917,12 @@ void OutputDevice::DrawDeviceAlphaBitmapSlowPath(const Bitmap& rBitmap, const Al
} }
else else
{ {
bool isBitmap24bitRGB = (pBitmapReadAccess->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_RGB || if( aContext.blendBitmap( Bitmap::ScopedWriteAccess(aBmp).get(), pBitmapReadAccess.get(), pAlphaReadAccess.get(),
pBitmapReadAccess->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_BGR); nDstWidth, nDstHeight))
{
if (GetBitCount() <= 8 && !isBitmap24bitRGB) aNewBitmap = aBmp;
}
else
{ {
aNewBitmap = BlendBitmap( aNewBitmap = BlendBitmap(
aBmp, pBitmapReadAccess.get(), pAlphaReadAccess.get(), aBmp, pBitmapReadAccess.get(), pAlphaReadAccess.get(),
...@@ -928,14 +932,6 @@ void OutputDevice::DrawDeviceAlphaBitmapSlowPath(const Bitmap& rBitmap, const Al ...@@ -928,14 +932,6 @@ void OutputDevice::DrawDeviceAlphaBitmapSlowPath(const Bitmap& rBitmap, const Al
bHMirr, bVMirr, bHMirr, bVMirr,
aContext.mpMapX.get(), aContext.mpMapY.get() ); aContext.mpMapX.get(), aContext.mpMapY.get() );
} }
else
{
Bitmap::ScopedWriteAccess pDestination(aBmp);
aContext.blendBitmap(
pDestination.get(), pBitmapReadAccess.get(), pAlphaReadAccess.get(),
nDstWidth, nDstHeight);
aNewBitmap = aBmp;
}
} }
// #110958# Disable alpha VDev, we're doing the necessary // #110958# Disable alpha VDev, we're doing the necessary
......
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