[Libreoffice-commits] core.git: vcl/source
Tomaž Vajngerl (via logerrit)
logerrit at kemper.freedesktop.org
Fri Jan 22 06:49:35 UTC 2021
vcl/source/gdi/impgraph.cxx | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
New commits:
commit 4cde10d255ce9741ca8ea115078b104dc4d67057
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sat Jan 2 00:03:33 2021 +0900
Commit: Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Fri Jan 22 07:48:53 2021 +0100
vcl: optimize copying size in px to ImpSwapInfo when swapping out
Calling getSizePixel can force to create a bitmap for vector
graphic, only for the purpuse to get the size of the graphic in
pixels. We use this when swapping out, which is not ideal as
we would force create a replacement bitmap just before we would
get rid of it. This optimization will just copy the size in pixels
to the ImpSwapInfo structure if a bitmap exists and otherwise
leave it empty.
Change-Id: I9ccb1af4ddc63e77e2a6ca536cb4f762d0b5f182
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109599
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index 6fe065896d3f..5e53a900a60f 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -334,7 +334,11 @@ void ImpGraphic::createSwapInfo()
if (isSwappedOut())
return;
- maSwapInfo.maSizePixel = getSizePixel();
+ if (!maBitmapEx.IsEmpty())
+ maSwapInfo.maSizePixel = maBitmapEx.GetSizePixel();
+ else
+ maSwapInfo.maSizePixel = Size();
+
maSwapInfo.maPrefMapMode = getPrefMapMode();
maSwapInfo.maPrefSize = getPrefSize();
maSwapInfo.mbIsAnimated = isAnimated();
More information about the Libreoffice-commits
mailing list