[Libreoffice-commits] online.git: kit/Kit.cpp
Miklos Vajna
vmiklos at collabora.co.uk
Fri May 25 07:12:12 UTC 2018
kit/Kit.cpp | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
New commits:
commit 8f4c348be35e63af28ea54093ba571b7ce3275b8
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Fri May 25 09:11:44 2018 +0200
kit: let getPixmap() return an std::vector<char> instead of raw pointer
So the callers can know not only the address of the pixmap, but also the
size of it.
Change-Id: I3aecc33cb354f5878364b11398c276fcabd3103e
diff --git a/kit/Kit.cpp b/kit/Kit.cpp
index 0b02d5569..25b03f2af 100644
--- a/kit/Kit.cpp
+++ b/kit/Kit.cpp
@@ -590,7 +590,7 @@ public:
int width = tileWidth * 0.9;
int height = tileHeight * 0.9;
- const unsigned char* pixmap = getPixmap(width, height);
+ const std::vector<unsigned char>* pixmap = getPixmap(width, height);
if (pixmap && tilePixmap)
{
@@ -600,7 +600,7 @@ public:
offsetX += (tileWidth - maxX) / 2;
offsetY += (tileHeight - maxY) / 2;
- alphaBlend(pixmap, _width, _height, offsetX, offsetY, tilePixmap, tilesPixmapWidth, tilesPixmapHeight);
+ alphaBlend(pixmap->data(), _width, _height, offsetX, offsetY, tilePixmap, tilesPixmapWidth, tilesPixmapHeight);
}
}
@@ -637,10 +637,10 @@ private:
}
/// Create bitmap that we later use as the watermark for every tile.
- const unsigned char* getPixmap(int width, int height)
+ const std::vector<unsigned char>* getPixmap(int width, int height)
{
if (!_pixmap.empty() && width == _width && height == _height)
- return _pixmap.data();
+ return &_pixmap;
_pixmap.clear();
@@ -712,7 +712,7 @@ private:
*p = static_cast<unsigned char>(*p * _alphaLevel);
}
- return _pixmap.data();
+ return &_pixmap;
}
private:
More information about the Libreoffice-commits
mailing list