summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2019-10-31 20:17:50 +0100
committerLuboš Luňák <l.lunak@collabora.com>2019-11-26 13:24:53 +0100
commit6aace342cd81364f9c08c47d5342fc4cb656d68e (patch)
tree62f093c0854a8b5a702545ff4867ad4dc564d43b
parent6a43ddcd77a18635fd92bbf26fa53bf429e69395 (diff)
backendtest: support creating VirtualDevice with alpha
Change-Id: I74c428b9b31b89536e72d53e418fc11b3f7e4e32
-rw-r--r--vcl/backendtest/outputdevice/common.cxx8
-rw-r--r--vcl/inc/test/outputdevice.hxx4
2 files changed, 8 insertions, 4 deletions
diff --git a/vcl/backendtest/outputdevice/common.cxx b/vcl/backendtest/outputdevice/common.cxx
index 167664d0e3d9..00c7b473e88a 100644
--- a/vcl/backendtest/outputdevice/common.cxx
+++ b/vcl/backendtest/outputdevice/common.cxx
@@ -223,7 +223,6 @@ const Color OutputDeviceTestCommon::constLineColor(COL_LIGHTBLUE);
const Color OutputDeviceTestCommon::constFillColor(COL_LIGHTBLUE);
OutputDeviceTestCommon::OutputDeviceTestCommon()
- : mpVirtualDevice(VclPtr<VirtualDevice>::Create())
{}
OUString OutputDeviceTestCommon::getRenderBackendName() const
@@ -236,8 +235,13 @@ OUString OutputDeviceTestCommon::getRenderBackendName() const
return OUString();
}
-void OutputDeviceTestCommon::initialSetup(long nWidth, long nHeight, Color aColor, bool bEnableAA)
+void OutputDeviceTestCommon::initialSetup(long nWidth, long nHeight, Color aColor, bool bEnableAA, bool bAlphaVirtualDevice)
{
+ if (bAlphaVirtualDevice)
+ mpVirtualDevice = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT, DeviceFormat::DEFAULT);
+ else
+ mpVirtualDevice = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT);
+
maVDRectangle = tools::Rectangle(Point(), Size (nWidth, nHeight));
mpVirtualDevice->SetOutputSizePixel(maVDRectangle.GetSize());
if (bEnableAA)
diff --git a/vcl/inc/test/outputdevice.hxx b/vcl/inc/test/outputdevice.hxx
index 7c7e71c975e2..587bb7507d2e 100644
--- a/vcl/inc/test/outputdevice.hxx
+++ b/vcl/inc/test/outputdevice.hxx
@@ -34,7 +34,7 @@ class VCL_DLLPUBLIC OutputDeviceTestCommon
{
protected:
- ScopedVclPtr<VirtualDevice> mpVirtualDevice;
+ VclPtr<VirtualDevice> mpVirtualDevice;
tools::Rectangle maVDRectangle;
static const Color constBackgroundColor;
@@ -46,7 +46,7 @@ public:
OUString getRenderBackendName() const;
- void initialSetup(long nWidth, long nHeight, Color aColor, bool bEnableAA = false);
+ void initialSetup(long nWidth, long nHeight, Color aColor, bool bEnableAA = false, bool bAlphaVirtualDevice = false);
static TestResult checkRectangle(Bitmap& rBitmap);
static TestResult checkRectangleAA(Bitmap& rBitmap);