[Libreoffice-commits] core.git: vcl/source
Chris Sherlock (via logerrit)
logerrit at kemper.freedesktop.org
Sat May 23 18:11:07 UTC 2020
vcl/source/gdi/print2.cxx | 29 +++++++++++++++++++++--------
1 file changed, 21 insertions(+), 8 deletions(-)
New commits:
commit 93649784ddbb7d9ca779d14fd60fb97385325d17
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
AuthorDate: Tue May 12 23:53:24 2020 +1000
Commit: Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Sat May 23 20:10:30 2020 +0200
vcl: move stage 1 functionality into DetectBackground()
Change-Id: I7a1785683868ca48156208bb08a80298b332fee2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94563
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
diff --git a/vcl/source/gdi/print2.cxx b/vcl/source/gdi/print2.cxx
index 8e4884a05a4d..1da4393c170a 100644
--- a/vcl/source/gdi/print2.cxx
+++ b/vcl/source/gdi/print2.cxx
@@ -752,6 +752,23 @@ void SetBackgroundColorAndBounds(ConnectedComponents& rBackgroundComponent, Colo
}
}
+int DetectBackground(ConnectedComponents& rBackgroundComponent, MetaAction* pCurrAct,
+ Color const & rBackgroundColor, tools::Rectangle const& rRectBounds,
+ GDIMetaFile const & rMtf, VirtualDevice* pMapModeVDev,
+ sal_uInt32 nDPIX, sal_uInt32 nDPIY)
+{
+ RecordMapModeChanges(pMapModeVDev, nDPIX, nDPIY);
+
+ // weed out page-filling background objects (if they are
+ // uniformly coloured). Keeping them outside the other
+ // connected components often prevents whole-page bitmap
+ // generation.
+ SetBackgroundColorAndBounds(rBackgroundComponent, rBackgroundColor, rRectBounds);
+ int nLastBgAction = FindIncompletelyOccludedBackground(rBackgroundComponent, rMtf, pMapModeVDev);
+ int nActionNum = GetActionAfterBackgroundAction(rBackgroundComponent, pCurrAct, rMtf, nLastBgAction, pMapModeVDev);
+ return nActionNum;
+}
+
} // end anon namespace
bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf, GDIMetaFile& rOutMtf,
@@ -807,19 +824,15 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf,
// create an OutputDevice to record mapmode changes and the like
ScopedVclPtrInstance< VirtualDevice > aMapModeVDev;
- RecordMapModeChanges(aMapModeVDev.get(), mnDPIX, mnDPIY);
// Receives uniform background content, and is _not_ merged
// nor checked for intersection against other aCCList elements
ConnectedComponents aBackgroundComponent;
- // weed out page-filling background objects (if they are
- // uniformly coloured). Keeping them outside the other
- // connected components often prevents whole-page bitmap
- // generation.
- SetBackgroundColorAndBounds(aBackgroundComponent, rBackground, GetBackgroundComponentBounds());
- int nLastBgAction = FindIncompletelyOccludedBackground(aBackgroundComponent, rInMtf, aMapModeVDev.get());
- int nActionNum = GetActionAfterBackgroundAction(aBackgroundComponent, pCurrAct, rInMtf, nLastBgAction, aMapModeVDev.get());
+ int nActionNum = DetectBackground(aBackgroundComponent, pCurrAct,
+ rBackground, GetBackgroundComponentBounds(),
+ rInMtf, aMapModeVDev.get(),
+ mnDPIX, mnDPIY);
// STAGE 2: Generate connected components list
More information about the Libreoffice-commits
mailing list