summaryrefslogtreecommitdiff
path: root/vcl/qa/cppunit/skia
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 /vcl/qa/cppunit/skia
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 'vcl/qa/cppunit/skia')
-rw-r--r--vcl/qa/cppunit/skia/skia.cxx13
1 files changed, 7 insertions, 6 deletions
diff --git a/vcl/qa/cppunit/skia/skia.cxx b/vcl/qa/cppunit/skia/skia.cxx
index f2990d3811fc..606541a0ac48 100644
--- a/vcl/qa/cppunit/skia/skia.cxx
+++ b/vcl/qa/cppunit/skia/skia.cxx
@@ -116,7 +116,7 @@ void SkiaTest::testDrawShaders()
{
if (!SkiaHelper::isVCLSkiaEnabled())
return;
- ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT);
+ ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA);
device->SetOutputSizePixel(Size(20, 20));
device->SetBackground(Wallpaper(COL_WHITE));
device->Erase();
@@ -159,7 +159,8 @@ void SkiaTest::testDrawShaders()
device->Erase();
// Test with scaling. Use everything 10x larger to reduce the impact of smoothscaling.
- ScopedVclPtr<VirtualDevice> deviceLarge = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT);
+ ScopedVclPtr<VirtualDevice> deviceLarge
+ = VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA);
deviceLarge->SetOutputSizePixel(Size(200, 200));
deviceLarge->SetBackground(Wallpaper(COL_WHITE));
deviceLarge->Erase();
@@ -439,7 +440,7 @@ void SkiaTest::testDrawDelayedScaleImage()
return;
if (SkiaHelper::renderMethodToUse() != SkiaHelper::RenderRaster)
return; // This test tests caching that's done only in raster mode.
- ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT);
+ ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA);
device->SetOutputSizePixel(Size(10, 10));
device->SetBackground(Wallpaper(COL_WHITE));
device->Erase();
@@ -513,7 +514,7 @@ void SkiaTest::testTdf137329()
return;
// Draw a filled polygon in the entire device, with AA enabled.
// All pixels in the device should be black, even those at edges (i.e. not affected by AA).
- ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT);
+ ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA);
device->SetOutputSizePixel(Size(10, 10));
device->SetBackground(Wallpaper(COL_WHITE));
device->SetAntialiasing(AntialiasingFlags::Enable);
@@ -534,7 +535,7 @@ void SkiaTest::testTdf140848()
{
if (!SkiaHelper::isVCLSkiaEnabled())
return;
- ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT);
+ ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA);
device->SetOutputSizePixel(Size(1300, 400));
device->SetBackground(Wallpaper(COL_BLACK));
device->SetAntialiasing(AntialiasingFlags::Enable);
@@ -562,7 +563,7 @@ void SkiaTest::testTdf132367()
{
if (!SkiaHelper::isVCLSkiaEnabled())
return;
- ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT);
+ ScopedVclPtr<VirtualDevice> device = VclPtr<VirtualDevice>::Create(DeviceFormat::WITHOUT_ALPHA);
device->SetOutputSizePixel(Size(2, 2));
device->SetBackground(Wallpaper(COL_BLACK));
device->Erase();