diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2024-07-12 10:06:30 +0500 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2024-07-12 12:06:48 +0200 |
commit | c2eb8d81e01ff016358c573b6d2f6c28e14f575a (patch) | |
tree | afd90aa54151ecaf8bc76e131e76bdf1ff860a47 /vcl/inc/impgraph.hxx | |
parent | ee63aeb69a0d5758a1f7acb65167c0a251e2da9a (diff) |
tdf#129244: Let ImpGraphic update its buffer for new pixel sizes
It used getVectorGraphicReplacement once, getting a bitmap with pixel
size that depended on the default device DPI, unrelated to the needed
bitmap size. It was not updated later, using the cached bitmap for any
requested size.
The DPI passed to convertPrimitive2DSequenceToBitmapEx must represent
the relation between the vector logic size and the pixel size of the
generated bitmap, not the target device DPI.
This change introduces VectorGraphicData::getBitmap to obtain a bitmap
for any requested pixel size, and uses it every time in the introduced
ImpGraphic::updateBitmapFromVectorGraphic method every time it needs a
new size of the image.
Change-Id: Ife1305821fff28f0cd4070615ab032211a5d8c4f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170391
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'vcl/inc/impgraph.hxx')
-rw-r--r-- | vcl/inc/impgraph.hxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/vcl/inc/impgraph.hxx b/vcl/inc/impgraph.hxx index e15845c9d99a..cad519c87e5c 100644 --- a/vcl/inc/impgraph.hxx +++ b/vcl/inc/impgraph.hxx @@ -200,7 +200,8 @@ private: const std::shared_ptr<VectorGraphicData>& getVectorGraphicData() const; /// Gets the bitmap replacement for a vector graphic. - BitmapEx getVectorGraphicReplacement() const; + // Hide volatile state of maBitmapEx when using maVectorGraphicData into this method + void updateBitmapFromVectorGraphic(const Size& pixelSize = {}) const; bool ensureAvailable () const; |