diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2023-12-04 11:17:23 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-12-07 09:32:14 +0100 |
commit | a214ac677481883d31800bc2b67fd3a9c504319d (patch) | |
tree | 97598a97a7b0745acaf4dc4e7587871794011227 /svx/qa/unit | |
parent | 7101c620857cb885076b85cd1447e50d30cab528 (diff) |
simplify and modernise ScopedBitmapAccess
(*) Make all of it use a "Scoped" paradigm
(*) pass by value, no need to allocate on heap
(*) make all of the construction go via the *Access constructors, instead of it being some via the constructors and some via the Acquire*Access methods.
(*) take the Bitmap& by const& in the constructor, so we can avoid doing const_cast in random places.
Change-Id: Ie03a9145c0965980ee8df9a89b8714a425e18f74
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160293
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/qa/unit')
-rw-r--r-- | svx/qa/unit/customshapes.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/svx/qa/unit/customshapes.cxx b/svx/qa/unit/customshapes.cxx index 34a60fdbc3e4..3ac58e33394b 100644 --- a/svx/qa/unit/customshapes.cxx +++ b/svx/qa/unit/customshapes.cxx @@ -189,7 +189,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf145700_3D_NonUI) vcl::PngImageReader aPNGReader(aFileStream); BitmapEx aBMPEx = aPNGReader.read(); Bitmap aBMP = aBMPEx.GetBitmap(); - Bitmap::ScopedReadAccess pRead(aBMP); + BitmapScopedReadAccess pRead(aBMP); Size aSize = aBMP.GetSizePixel(); // GetColor(Y,X) Color aActualColor = pRead->GetColor(aSize.Height() / 2, aSize.Width() * 0.125); @@ -225,7 +225,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf145700_3D_FrontLightDim) vcl::PngImageReader aPNGReader(aFileStream); BitmapEx aBMPEx = aPNGReader.read(); Bitmap aBMP = aBMPEx.GetBitmap(); - Bitmap::ScopedReadAccess pRead(aBMP); + BitmapScopedReadAccess pRead(aBMP); Size aSize = aBMP.GetSizePixel(); // GetColor(Y,X) Color aActualColor = pRead->GetColor(aSize.Height() / 2, aSize.Width() * 0.4); @@ -252,7 +252,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf145700_3D_FirstLightHarsh) vcl::PngImageReader aPNGReader(aFileStream); BitmapEx aBMPEx = aPNGReader.read(); Bitmap aBMP = aBMPEx.GetBitmap(); - Bitmap::ScopedReadAccess pRead(aBMP); + BitmapScopedReadAccess pRead(aBMP); Size aSize = aBMP.GetSizePixel(); // GetColor(Y,X) const Color aActualColor = pRead->GetColor(aSize.Height() / 2, aSize.Width() / 2); @@ -1221,7 +1221,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf148501_OctagonBevel) vcl::PngImageReader aPNGReader(aFileStream); BitmapEx aBMPEx = aPNGReader.read(); Bitmap aBMP = aBMPEx.GetBitmap(); - Bitmap::ScopedReadAccess pRead(aBMP); + BitmapScopedReadAccess pRead(aBMP); Size aSize = aBMP.GetSizePixel(); // GetColor(Y,X). The chosen threshold for the ColorDistance can be adapted if necessary. |