summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-02-06 18:14:16 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-02-07 10:19:32 +0000
commit00659bcdbbb167596e6fd18e283a54819dd6fe91 (patch)
tree65316f99002c5aa6851ee1770df557b789772f20 /drawinglayer
parent545ddfbaa98cfeaa35c95d7db7b16cd241cedc89 (diff)
improve readability of VirtualDevice constructor
(a) It is not obvious what DeviceFormat::DEFAULT means (b) There are two parameters (each with two states), but only really 2 possible overall states So (1) use more useful names (2) combine the two parameters into one enum Change-Id: Ic0595b39e032cc9e019b88326389d055b977da00 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146589 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/qa/unit/vclmetafileprocessor2d.cxx5
-rw-r--r--drawinglayer/qa/unit/vclpixelprocessor2d.cxx3
-rw-r--r--drawinglayer/source/processor2d/vclhelperbufferdevice.cxx2
3 files changed, 5 insertions, 5 deletions
diff --git a/drawinglayer/qa/unit/vclmetafileprocessor2d.cxx b/drawinglayer/qa/unit/vclmetafileprocessor2d.cxx
index 4f0a312ec1d7..478645cbf5b1 100644
--- a/drawinglayer/qa/unit/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/qa/unit/vclmetafileprocessor2d.cxx
@@ -61,9 +61,8 @@ public:
void setupCanvas(const Size& size, Color backgroundColor = COL_WHITE, bool alpha = false)
{
- mVclDevice
- = alpha ? VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT, DeviceFormat::DEFAULT)
- : VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT);
+ mVclDevice = alpha ? VclPtr<VirtualDevice>::Create(DeviceFormat::WITH_ALPHA)
+ : VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA);
mVclDevice->SetOutputSizePixel(size);
mVclDevice->SetBackground(Wallpaper(backgroundColor));
mVclDevice->Erase();
diff --git a/drawinglayer/qa/unit/vclpixelprocessor2d.cxx b/drawinglayer/qa/unit/vclpixelprocessor2d.cxx
index daf54c910e29..573c4bdc32f0 100644
--- a/drawinglayer/qa/unit/vclpixelprocessor2d.cxx
+++ b/drawinglayer/qa/unit/vclpixelprocessor2d.cxx
@@ -46,7 +46,8 @@ public:
// Test that drawing only a part of a gradient draws the proper part of it.
void testTdf139000()
{
- ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT);
+ ScopedVclPtr<VirtualDevice> device
+ = VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA);
device->SetOutputSizePixel(Size(100, 200));
device->SetBackground(Wallpaper(COL_RED));
device->Erase();
diff --git a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
index f4373778ceb0..37dae31a4e26 100644
--- a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
+++ b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
@@ -234,7 +234,7 @@ VclPtr<VirtualDevice> VDevBuffer::alloc(OutputDevice& rOutDev, const Size& rSize
// no success yet, create new buffer
if (!pRetval)
{
- pRetval = VclPtr<VirtualDevice>::Create(rOutDev, DeviceFormat::DEFAULT);
+ pRetval = VclPtr<VirtualDevice>::Create(rOutDev, DeviceFormat::WITHOUT_ALPHA);
maDeviceTemplates[pRetval] = &rOutDev;
pRetval->SetOutputSizePixel(rSizePixel, true);
}