[Libreoffice-commits] core.git: Branch 'feature/drawinglayercore' - vcl/inc vcl/source
Tomaž Vajngerl (via logerrit)
logerrit at kemper.freedesktop.org
Wed Apr 22 18:00:10 UTC 2020
vcl/inc/impgraph.hxx | 2 +-
vcl/source/gdi/impgraph.cxx | 31 ++++++++++++++++---------------
2 files changed, 17 insertions(+), 16 deletions(-)
New commits:
commit ca500809ad73b175d26b4c39516f34901532e5b0
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Wed Apr 22 19:52:19 2020 +0200
Commit: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Wed Apr 22 19:59:32 2020 +0200
ImpGraphic: rename ImplCreateSwapInfo and simplify
ImplCreateSwapInfo changed to createSwapInfo.
Flatten the code body
Change-Id: I5865373d0b7f3cc717a9600bcf6fd198e8320e35
diff --git a/vcl/inc/impgraph.hxx b/vcl/inc/impgraph.hxx
index 47bc06d0ce6b..f0b00f7d10b0 100644
--- a/vcl/inc/impgraph.hxx
+++ b/vcl/inc/impgraph.hxx
@@ -115,7 +115,7 @@ private:
return mpGraphicID->getIDString();
}
- void ImplCreateSwapInfo();
+ void createSwapInfo();
void ImplClearGraphics();
void ImplClear();
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index ef63bb9e8cb2..2a167e0024a3 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -376,18 +376,18 @@ const std::shared_ptr<VectorGraphicData>& ImpGraphic::getVectorGraphicData() con
return maVectorGraphicData;
}
-void ImpGraphic::ImplCreateSwapInfo()
+void ImpGraphic::createSwapInfo()
{
- if (!isSwappedOut())
- {
- maSwapInfo.maPrefMapMode = ImplGetPrefMapMode();
- maSwapInfo.maPrefSize = ImplGetPrefSize();
- maSwapInfo.mbIsAnimated = ImplIsAnimated();
- maSwapInfo.mbIsEPS = ImplIsEPS();
- maSwapInfo.mbIsTransparent = ImplIsTransparent();
- maSwapInfo.mbIsAlpha = ImplIsAlpha();
- maSwapInfo.mnAnimationLoopCount = ImplGetAnimationLoopCount();
- }
+ if (isSwappedOut())
+ return;
+
+ maSwapInfo.maPrefMapMode = ImplGetPrefMapMode();
+ maSwapInfo.maPrefSize = ImplGetPrefSize();
+ maSwapInfo.mbIsAnimated = ImplIsAnimated();
+ maSwapInfo.mbIsEPS = ImplIsEPS();
+ maSwapInfo.mbIsTransparent = ImplIsTransparent();
+ maSwapInfo.mbIsAlpha = ImplIsAlpha();
+ maSwapInfo.mnAnimationLoopCount = ImplGetAnimationLoopCount();
}
void ImpGraphic::ImplClearGraphics()
@@ -1380,12 +1380,13 @@ bool ImpGraphic::swapOut()
// Check if writing was successfull
if (bResult)
{
- // We have swapped out, so can clean memory
- mbSwapOut = true;
- mpSwapFile = std::move(pSwapFile);
- ImplCreateSwapInfo();
+ // We have swapped out, so can clean memory and prepare swap info
+ createSwapInfo();
ImplClearGraphics();
+ mpSwapFile = std::move(pSwapFile);
+ mbSwapOut = true;
+
// Signal to manager that we have swapped out
vcl::graphic::Manager::get().swappedOut(this);
}
More information about the Libreoffice-commits
mailing list