diff options
Diffstat (limited to 'basebmp')
-rw-r--r-- | basebmp/source/bitmapdevice.cxx | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/basebmp/source/bitmapdevice.cxx b/basebmp/source/bitmapdevice.cxx index 0c8db660d15d..84f5e3c9dff8 100644 --- a/basebmp/source/bitmapdevice.cxx +++ b/basebmp/source/bitmapdevice.cxx @@ -749,21 +749,33 @@ namespace char* srcBuf = (char*)rSrcBitmap->getBuffer().get(); sal_Int32 dstStride = getScanlineStride(); sal_Int32 srcStride = rSrcBitmap->getScanlineStride(); - int bytesPerPixel = (bitsPerPixel[getScanlineFormat()] + 7) >> 3; // round up to bytes + sal_Int32 bytesPerPixel = (bitsPerPixel[getScanlineFormat()] + 7) >> 3; // round up to bytes + bool dstTopDown = isTopDown(); + bool srcTopDown = rSrcBitmap->isTopDown(); if (dstBuf == srcBuf && nSrcY < nDestY) // reverse copy order to avoid overlapping { - dstBuf += dstStride * (getBufferSize().getY() - 1); - srcBuf += srcStride * (getBufferSize().getY() - 1); nSrcY = getBufferSize().getY() - nSrcY - nSrcHeight; nDestY = getBufferSize().getY() - nDestY - nSrcHeight; + srcTopDown = !srcTopDown; + dstTopDown = !dstTopDown; + } + + if (!dstTopDown) + { + dstBuf += dstStride * (getBufferSize().getY() - 1); dstStride = -dstStride; + } + + if (!srcTopDown) + { + srcBuf += srcStride * (rSrcBitmap->getBufferSize().getY() - 1); srcStride = -srcStride; } char* dstline = dstBuf + dstStride * nDestY + nDestX * bytesPerPixel; char* srcline = srcBuf + srcStride * nSrcY + nSrcX * bytesPerPixel; - int lineBytes = nSrcWidth * bytesPerPixel; + sal_Int32 lineBytes = nSrcWidth * bytesPerPixel; for(; 0 < nSrcHeight; nSrcHeight--) { @@ -1916,6 +1928,8 @@ inline sal_uInt32 nextPow2( sal_uInt32 x ) } + + namespace { BitmapDeviceSharedPtr createBitmapDeviceImplInner( const basegfx::B2IVector& rSize, |