[Libreoffice-commits] core.git: vcl/skia
LuboÅ¡ LuÅák (via logerrit)
logerrit at kemper.freedesktop.org
Tue Jan 21 10:24:54 UTC 2020
vcl/skia/salbmp.cxx | 42 ++++++++++++++++++++++--------------------
1 file changed, 22 insertions(+), 20 deletions(-)
New commits:
commit e7b8ed940ecc5397212ae25f48e58618fa8ac6fd
Author: Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Mon Jan 20 15:45:20 2020 +0100
Commit: Luboš Luňák <l.lunak at collabora.com>
CommitDate: Tue Jan 21 11:24:19 2020 +0100
implement bit depth data conversion for SkiaSalBitmap, just in case
Change-Id: I456d7bf8ca8c906c384372e00a4e57e4e6e726d2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87077
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak at collabora.com>
diff --git a/vcl/skia/salbmp.cxx b/vcl/skia/salbmp.cxx
index 925e27f6d9a8..b321f4c3f6f7 100644
--- a/vcl/skia/salbmp.cxx
+++ b/vcl/skia/salbmp.cxx
@@ -177,29 +177,31 @@ bool SkiaSalBitmap::Create(const SalBitmap& rSalBmp, SalGraphics* pGraphics)
bool SkiaSalBitmap::Create(const SalBitmap& rSalBmp, sal_uInt16 nNewBitCount)
{
const SkiaSalBitmap& src = static_cast<const SkiaSalBitmap&>(rSalBmp);
- if (nNewBitCount == src.GetBitCount())
- {
- mBitmap = src.mBitmap;
- // SkBitmap shares pixels on copy.
- assert(mBitmap.getPixels() == src.mBitmap.getPixels());
- mImage = src.mImage;
- mAlphaImage = src.mAlphaImage;
- mBuffer = src.mBuffer;
- mPalette = src.mPalette;
- mBitCount = src.mBitCount;
- mSize = src.mSize;
- mScanlineSize = src.mScanlineSize;
+ mBitmap = src.mBitmap;
+ // SkBitmap shares pixels on copy.
+ assert(mBitmap.getPixels() == src.mBitmap.getPixels());
+ mImage = src.mImage;
+ mAlphaImage = src.mAlphaImage;
+ mBuffer = src.mBuffer;
+ mPalette = src.mPalette;
+ mBitCount = src.mBitCount;
+ mSize = src.mSize;
+ mScanlineSize = src.mScanlineSize;
#ifdef DBG_UTIL
- mWriteAccessCount = 0;
+ mWriteAccessCount = 0;
#endif
- SAL_INFO("vcl.skia", "create(" << this << "): (" << &src << ")");
- return true;
+ if (nNewBitCount != src.GetBitCount())
+ {
+ // This appears to be unused(?). Implement this just in case, but be lazy
+ // about it and rely on EnsureBitmapData() doing the conversion from mImage
+ // if needed, even if that may need unnecessary to- and from- SkImage
+ // conversion.
+ GetSkImage(); // create mImage
+ mBitmap.reset();
+ mBuffer.reset();
}
- if (!Create(src.mSize, src.mBitCount, src.mPalette))
- return false;
- // TODO copy data
- SAL_INFO("vcl.skia", "copy(" << this << "): (" << &src << ")");
- abort();
+ SAL_INFO("vcl.skia", "create(" << this << "): (" << &src << ")");
+ return true;
}
bool SkiaSalBitmap::Create(const css::uno::Reference<css::rendering::XBitmapCanvas>&, Size&, bool)
More information about the Libreoffice-commits
mailing list