diff options
author | Mark Page <aptitude@btconnect.com> | 2016-12-05 14:03:12 +0000 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-12-06 18:17:56 +0000 |
commit | d08db164dcac8f6aa88158b2848abb5ad66a4052 (patch) | |
tree | bacb0e7b183115e3b00bd4c375b37908264f0f87 /drawinglayer | |
parent | 0c6c37cb01c242ad9324bc91ac15c974529086c5 (diff) |
Change Read/Write access to Scoped Read/Write access
Change-Id: Idbe8e393b64f2a151e20c1851d7c14fa161acf97
Reviewed-on: https://gerrit.libreoffice.org/31635
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'drawinglayer')
-rw-r--r-- | drawinglayer/source/primitive2d/sceneprimitive2d.cxx | 8 | ||||
-rw-r--r-- | drawinglayer/source/texture/texture3d.cxx | 9 |
2 files changed, 7 insertions, 10 deletions
diff --git a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx index 6470f634c187..73fd8cbc4fae 100644 --- a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx @@ -52,8 +52,8 @@ namespace sal_uInt8 nInitAlpha(255); Bitmap aContent(aDestSize, 24); AlphaMask aAlpha(aDestSize, &nInitAlpha); - BitmapWriteAccess* pContent = aContent.AcquireWriteAccess(); - BitmapWriteAccess* pAlpha = aAlpha.AcquireWriteAccess(); + Bitmap::ScopedWriteAccess pContent(aContent); + AlphaMask::ScopedWriteAccess pAlpha(aAlpha); if (pContent && pAlpha) { @@ -118,8 +118,8 @@ namespace } } - aAlpha.ReleaseAccess(pAlpha); - Bitmap::ReleaseAccess(pContent); + pAlpha.reset(); + pContent.reset(); aRetval = BitmapEx(aContent, aAlpha); diff --git a/drawinglayer/source/texture/texture3d.cxx b/drawinglayer/source/texture/texture3d.cxx index 4e4d19b6dd5f..a1ba4cb39ce0 100644 --- a/drawinglayer/source/texture/texture3d.cxx +++ b/drawinglayer/source/texture/texture3d.cxx @@ -64,9 +64,7 @@ namespace drawinglayer const BitmapEx& rBitmapEx, const basegfx::B2DRange& rRange) : maBitmapEx(rBitmapEx), - mpReadBitmap(nullptr), maTransparence(), - mpReadTransparence(nullptr), maTopLeft(rRange.getMinimum()), maSize(rRange.getRange()), mfMulX(0.0), @@ -75,7 +73,8 @@ namespace drawinglayer mbIsTransparent(maBitmapEx.IsTransparent()) { // #121194# Todo: use alpha channel, too (for 3d) - mpReadBitmap = maBitmapEx.GetBitmap().AcquireReadAccess(); + maBitmap = maBitmapEx.GetBitmap(); + mpReadBitmap = Bitmap::ScopedReadAccess(maBitmap); OSL_ENSURE(mpReadBitmap, "GeoTexSvxBitmapEx: Got no read access to Bitmap (!)"); if(mbIsTransparent) @@ -90,7 +89,7 @@ namespace drawinglayer maTransparence = rBitmapEx.GetMask(); } - mpReadTransparence = maTransparence.AcquireReadAccess(); + mpReadTransparence = Bitmap::ScopedReadAccess(maTransparence); } mfMulX = (double)mpReadBitmap->Width() / maSize.getX(); @@ -109,8 +108,6 @@ namespace drawinglayer GeoTexSvxBitmapEx::~GeoTexSvxBitmapEx() { - delete mpReadTransparence; - delete mpReadBitmap; } sal_uInt8 GeoTexSvxBitmapEx::impGetTransparence(sal_Int32& rX, sal_Int32& rY) const |