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 /desktop | |
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 'desktop')
-rw-r--r-- | desktop/inc/pch/precompiled_sofficeapp.hxx | 1 | ||||
-rw-r--r-- | desktop/source/lib/init.cxx | 4 |
2 files changed, 2 insertions, 3 deletions
diff --git a/desktop/inc/pch/precompiled_sofficeapp.hxx b/desktop/inc/pch/precompiled_sofficeapp.hxx index f39dc60aff16..3635613937e9 100644 --- a/desktop/inc/pch/precompiled_sofficeapp.hxx +++ b/desktop/inc/pch/precompiled_sofficeapp.hxx @@ -107,7 +107,6 @@ #include <vcl/font.hxx> #include <vcl/mapmod.hxx> #include <vcl/region.hxx> -#include <vcl/scopedbitmapaccess.hxx> #include <vcl/vclenum.hxx> #include <vcl/vclptr.hxx> #endif // PCH_LEVEL >= 2 diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index fa1c55c09e05..e5aaa66ddb35 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -4221,8 +4221,8 @@ static void doc_paintTile(LibreOfficeKitDocument* pThis, BitmapEx aBmpEx = pDevice->GetBitmapEx({ 0, 0 }, { nCanvasWidth, nCanvasHeight }); Bitmap aBmp = aBmpEx.GetBitmap(); AlphaMask aAlpha = aBmpEx.GetAlphaMask(); - Bitmap::ScopedReadAccess sraBmp(aBmp); - AlphaMask::ScopedReadAccess sraAlpha(aAlpha); + BitmapScopedReadAccess sraBmp(aBmp); + BitmapScopedReadAccess sraAlpha(aAlpha); assert(sraBmp->Height() == nCanvasHeight); assert(sraBmp->Width() == nCanvasWidth); |