Kaydet (Commit) bad9b2d4 authored tarafından Jan Holesovsky's avatar Jan Holesovsky Kaydeden (comit) Markus Mohrhard

vcl: The backend should decide whether fast alpha drawing is available.

The unx drawAlphaBitmap() already already checks that the source and
destination have the same size.

Windows and OpenGL should be able to handle that without trouble.

OS X would need some additional code, so added an early return for the case
the source and result sizes do not match.

Change-Id: Ib09654aaa9c9064c232cff5094fcaa1190e931c6
üst 1e15058e
......@@ -568,6 +568,12 @@ bool AquaSalGraphics::drawAlphaBitmap( const SalTwoRect& rTR,
{
DBG_DRAW_OPERATION("drawAlphaBitmap", true);
if (rTR.mnSrcWidth != rTR.mnDestWidth || rTR.mnSrcHeight != rTR.mnDestHeight)
{
// TODO - would be better to scale it by the native code
return false;
}
// An image mask can't have a depth > 8 bits (should be 1 to 8 bits)
if( rAlphaBmp.GetBitCount() > 8 )
{
......
......@@ -524,10 +524,10 @@ void OutputDevice::DrawDeviceBitmap( const Point& rDestPt, const Size& rDestSize
if (bTryDirectPaint)
{
// only paint direct when no scaling and no MapMode, else the
// only paint direct when no MapMode, else the
// more expensive conversions may be done for short-time Bitmap/BitmapEx
// used for buffering only
if (IsMapMode() || aPosAry.mnSrcWidth != aPosAry.mnDestWidth || aPosAry.mnSrcHeight != aPosAry.mnDestHeight)
if (IsMapMode())
{
bTryDirectPaint = false;
}
......@@ -663,10 +663,10 @@ void OutputDevice::DrawDeviceAlphaBitmap( const Bitmap& rBmp, const AlphaMask& r
if (bTryDirectPaint)
{
// only paint direct when no scaling and no MapMode, else the
// only paint direct when no MapMode, else the
// more expensive conversions may be done for short-time Bitmap/BitmapEx
// used for buffering only
if (IsMapMode() || rSrcSizePixel.Width() != aOutSz.Width() || rSrcSizePixel.Height() != aOutSz.Height())
if (IsMapMode())
{
bTryDirectPaint = false;
}
......
......@@ -774,17 +774,6 @@ void WinSalGraphicsImpl::drawBitmap( const SalTwoRect& rPosAry,
DBG_ASSERT( !mrParent.isPrinter(), "No transparency print possible!" );
bool bTryDirectPaint(!mrParent.isPrinter() && !mbXORMode);
if(bTryDirectPaint)
{
// only paint direct when no scaling and no MapMode, else the
// more expensive conversions may be done for short-time Bitmap/BitmapEx
// used for buffering only
if(rPosAry.mnSrcWidth == rPosAry.mnDestWidth && rPosAry.mnSrcHeight == rPosAry.mnDestHeight)
{
bTryDirectPaint = false;
}
}
// try to draw using GdiPlus directly
if(bTryDirectPaint && drawAlphaBitmap(rPosAry, rSSalBitmap, rSTransparentBitmap))
{
......
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