summaryrefslogtreecommitdiff
path: root/vcl/backendtest
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2020-01-09 13:21:04 +0100
committerLuboš Luňák <l.lunak@collabora.com>2020-01-09 15:25:25 +0100
commit3aa151e4de4c02b094acb6fa8a919cc86051a6fd (patch)
tree5402724508144c327c41e67c7ba77ca092aa7eb7 /vcl/backendtest
parent8a78de65b5472b933267601cd484f3ff5e75c2a3 (diff)
fix Skia virtual device alpha blending (tdf#129865)
The blendBitmap()/blendAlphaBitmap() stuff coming from the OpenGL code is some undocumented crazy stuff (probably because the VirtualDevice alpha handling itself is rather crazy). Hopefully I've finally figured it out to work properly for Skia too. This separate alpha handling all over the place in VCL should be just nuked. Change-Id: I82615a9be7064e9ade00ec4970a131a80a543c14 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86488 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'vcl/backendtest')
-rw-r--r--vcl/backendtest/outputdevice/bitmap.cxx12
1 files changed, 7 insertions, 5 deletions
diff --git a/vcl/backendtest/outputdevice/bitmap.cxx b/vcl/backendtest/outputdevice/bitmap.cxx
index 66a0a64adf49..2e7e0713294a 100644
--- a/vcl/backendtest/outputdevice/bitmap.cxx
+++ b/vcl/backendtest/outputdevice/bitmap.cxx
@@ -133,10 +133,13 @@ BitmapEx OutputDeviceTestBitmap::setupDrawBlend()
aWriteAccess->DrawRect(tools::Rectangle(3, 3, 5, 5));
}
- initialSetup(13, 13, constBackgroundColor, false, true);
+ initialSetup(13, 13, COL_TRANSPARENT, false, true);
mpVirtualDevice->SetFillColor(constBackgroundColor);
mpVirtualDevice->SetLineColor(constBackgroundColor);
- mpVirtualDevice->DrawRect(maVDRectangle);
+ // Leave the outer part of the device transparent, the inner part set to the background color.
+ // This will test blending of VirtualDevice's "alpha" device (outer yellow rectangle
+ // will be blended with transparent background, inner with the grey one).
+ mpVirtualDevice->DrawRect( tools::Rectangle( Point( 3, 3 ), Size( 7, 7 )));
Point aPoint(alignToCenter(maVDRectangle, tools::Rectangle(Point(), aBitmapSize)).TopLeft());
@@ -179,9 +182,8 @@ TestResult OutputDeviceTestBitmap::checkBlend(BitmapEx& rBitmapEx)
std::vector<Color> aExpected
{
- constBackgroundColor, constBackgroundColor,
- aBlendedColor, constBackgroundColor, constBackgroundColor,
- aBlendedColor, constBackgroundColor
+ COL_WHITE, COL_WHITE, COL_YELLOW, constBackgroundColor,
+ constBackgroundColor, aBlendedColor, constBackgroundColor
};
Bitmap aBitmap(rBitmapEx.GetBitmap());
return checkRectangles(aBitmap, aExpected);