svx: cache PNG export of graphic shapes

Desktop / LibreOffice - Miklos Vajna [collabora.com] - 25 February 2020 09:03 EST

One scenario where this is useful is: manipulate a JPEG photo in Online's Impress, e.g. resize it multiple times. Each time we generate an SVG preview of the shape, which includes the PNG export of the bitmap itself.

This helps with a desktop CPU:

debug:9976:9974: SVGFilter::filter finished in 3422 ms debug:9976:9974: SVGFilter::filter finished in 176 ms

But it is meant to help on mobile, too, where writing such a bitmap as PNG takes 16-17 seconds without this.

(This works because SVG writes the original bitmap, even if it's scaled. If that invariant will be broken in the future, we still emit correct output, but then the cache will be less useful.)

Change-Id: I7204b04efeeb42c6eec67f04dfdb8a4ed50443a9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89377

570be56b37e4 svx: cache PNG export of graphic shapes
filter/source/svg/svgwriter.cxx | 58 ++++++++++++++++++++++++++++++++++-------
filter/source/svg/svgwriter.hxx | 2 +-
include/svx/svdograf.hxx | 9 +++++++
include/svx/unoshape.hxx | 2 +-
svx/source/svdraw/svdograf.cxx | 22 ++++++++++++++++
5 files changed, 82 insertions(+), 11 deletions(-)

Upstream: cgit.freedesktop.org


  • Share