vcl/source/gdi/impgraph.cxx |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 4cde10d255ce9741ca8ea115078b104dc4d67057
Author:     Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk>
AuthorDate: Sat Jan 2 00:03:33 2021 +0900
Commit:     Tomaž Vajngerl <qui...@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 <qui...@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();
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to