diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-02-25 11:28:44 +0100 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2020-02-26 09:59:13 +0100 |
commit | 5aae00b8a9400dad43004081db69996c24157641 (patch) | |
tree | 0226c4a94a1b3b10c34f9c3c2218b823b4f266d9 /svx | |
parent | 4e19d09360220a181d7bdad92e6112390ff49f39 (diff) |
SVG export: try to reuse original bitmap data for JPG and PNG bitmaps
This has a number of benefits:
1) For a sample JPG photo, the SVG output is now 4,9MB, not 20MB.
2) Even the first export to SVG is fast, see commit
570be56b37e4ff105649e604ff4c8a6c368e2e79 (svx: cache PNG export of
graphic shapes, 2020-02-25) for exact numbers.
3) Allow using less memory as the SdrGrafObj doesn't have to store a PNG
result till the document is closed.
We still require matching checksums, so in case anything problematic
happens with the bitmap (grayscale filter applied, etc), then the
optimization is meant to not help, but still produces correct output.
(cherry picked from commit c7af36a6504a192f72fcd3a30712ca8c14e12fa5)
Conflicts:
include/svx/svdograf.hxx
Change-Id: Id3bc359a8dcc4c4d12d3b66ffb512cfa71939a26
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89465
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/svdraw/svdograf.cxx | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index b68aec25b2a3..0e4413b3764f 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -1265,26 +1265,4 @@ void SdrGrafObj::addCropHandles(SdrHdlList& rTarget) const rTarget.AddHdl(o3tl::make_unique<SdrCropHdl>(Point(basegfx::fround(aPos.getX()), basegfx::fround(aPos.getY())), SdrHdlKind::LowerRight, fShearX, fRotate)); } -void SdrGrafObj::SetPNGPreviewChecksum(BitmapChecksum nPNGPreviewChecksum) -{ - mnPNGPreviewChecksum = nPNGPreviewChecksum; -} - -BitmapChecksum SdrGrafObj::GetPNGPreviewChecksum() const -{ - return mnPNGPreviewChecksum; -} - -void SdrGrafObj::SetPNGPreviewData(SvMemoryStream& rPNGPreviewData) -{ - rPNGPreviewData.Seek(0); - maPNGPreviewData.resize(rPNGPreviewData.remainingSize()); - rPNGPreviewData.ReadBytes(maPNGPreviewData.data(), maPNGPreviewData.size()); -} - -const std::vector<sal_Int8>& SdrGrafObj::GetPNGPreviewData() const -{ - return maPNGPreviewData; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |