diff options
-rw-r--r-- | basebmp/source/bitmapdevice.cxx | 13 | ||||
-rw-r--r-- | include/basebmp/bitmapdevice.hxx | 3 |
2 files changed, 12 insertions, 4 deletions
diff --git a/basebmp/source/bitmapdevice.cxx b/basebmp/source/bitmapdevice.cxx index d1a19f938d07..ff017ec50e34 100644 --- a/basebmp/source/bitmapdevice.cxx +++ b/basebmp/source/bitmapdevice.cxx @@ -680,7 +680,7 @@ namespace destIterRange(begin, acc, rDstRect), - rSrcBitmap.get() == this ); + isSharedBuffer(rSrcBitmap) ); damaged( rDstRect ); } @@ -903,7 +903,7 @@ namespace Masks::clipmask_polarity, FastMask >::type(acc), rDstRect), - rSrcBitmap.get() == this); + isSharedBuffer(rSrcBitmap)); damaged( rDstRect ); } @@ -1147,6 +1147,11 @@ PaletteMemorySharedVector BitmapDevice::getPalette() const return mpImpl->mpPalette; } +bool BitmapDevice::isSharedBuffer( const BitmapDeviceSharedPtr& rOther ) const +{ + return rOther.get()->getBuffer().get() == getBuffer().get(); +} + void BitmapDevice::clear( Color fillColor ) { clear_i( fillColor, mpImpl->maBounds ); @@ -1507,7 +1512,7 @@ void BitmapDevice::drawMaskedColor( Color aSrcColor, assertImagePoint(aDestPoint,mpImpl->maBounds); assertImageRange(aSrcRange,aSrcBounds); - if( rAlphaMask.get() == this ) + if( isSharedBuffer(rAlphaMask) ) { // src == dest, copy rAlphaMask beforehand // --------------------------------------------------- @@ -1560,7 +1565,7 @@ void BitmapDevice::drawMaskedColor( Color aSrcColor, if( isCompatibleClipMask( rClip ) ) { - if( rAlphaMask.get() == this ) + if( isSharedBuffer(rAlphaMask) ) { // src == dest, copy rAlphaMask beforehand // --------------------------------------------------- diff --git a/include/basebmp/bitmapdevice.hxx b/include/basebmp/bitmapdevice.hxx index 941b01c840c3..84c6d75f32bd 100644 --- a/include/basebmp/bitmapdevice.hxx +++ b/include/basebmp/bitmapdevice.hxx @@ -140,6 +140,9 @@ public: */ PaletteMemorySharedVector getPalette() const; + /// Check if this and the other BitmapDevice share a buffer + bool isSharedBuffer( const BitmapDeviceSharedPtr& rOther ) const; + /** Clear whole device with given color This method works like a fill with the given color value, |