diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-04-14 09:07:33 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-04-14 09:42:52 +0200 |
commit | 952cc68929f863784c6b01c9dc071494892877d1 (patch) | |
tree | a23d8b604555c8beaa987f2b3a4d0c29e1acc587 /sw/qa | |
parent | 6ab37705448393c2d4253fb9970caf73142a99f0 (diff) |
tdf#131496 vcl image lazy load: speed up vector images with custom pref size
This speeds up the loading of the bugdoc:
- old cost: 6378 ms
- new cost: 1891 ms (30% of baseline)
Images were initially loaded at import time, but commit
acb803b730f2c6bd82e39beab58949ec14f85eb0 (tdf#125591 DOC import:
lazy-load metafiles with explicit size, 2019-06-11) changed this, so
that they are lazy-loaded. That improved performance, but sometimes gave
incorrect results.
Then commit d8371cdfd092c6426c01aae130ea4eaa6d627a6f (tdf#127446 vcl
image lazy-load: fix custom size handling of metafiles, 2019-09-30)
fixed the correctness problem, but the loading was no longer lazy in the
tdf#131496 case.
This is an attempt to bring back lazy-loading for vector-based images,
while maintaining the correct preferred size.
The problem was that the PPT import triggered a vector -> bitmap
conversion during load:
#0 0x00007ffff03c7e36 in ImpGraphic::loadPrepared() (this=this@entry=0x1f88a90) at vcl/source/gdi/impgraph.cxx:1424
#1 0x00007ffff03c72c7 in ImpGraphic::ImplSwapIn() (this=0x1f88a90) at vcl/source/gdi/impgraph.cxx:1444
#2 0x00007ffff03c7535 in ImpGraphic::ensureAvailable() const (this=this@entry=0x1f88a90) at vcl/source/gdi/impgraph.cxx:1402
#3 0x00007ffff03c9481 in ImpGraphic::ImplExportNative(SvStream&) const (this=0x1f88a90, rOStm=...) at vcl/source/gdi/impgraph.cxx:1590
#4 0x00007ffff03bf9a8 in Graphic::ExportNative(SvStream&) const (this=this@entry=0x20534e0, rOStream=...) at vcl/source/gdi/graph.cxx:544
#5 0x00007ffff1c79a28 in svt::EmbeddedObjectRef::SetGraphicToContainer(Graphic const&, comphelper::EmbeddedObjectContainer&, rtl::OUString const&, rtl::OUString const&)
(rGraphic=..., aContainer=..., aName="Object 1", aMediaType="") at svtools/source/misc/embedhlp.cxx:773
#6 0x00007ffff1c79b6f in svt::EmbeddedObjectRef::AssignToContainer(comphelper::EmbeddedObjectContainer*, rtl::OUString const&)
(this=0x207ae90, pContainer=pContainer@entry=0x1f8de40, rPersistName=...) at svtools/source/misc/embedhlp.cxx:369
#7 0x00007ffff239f736 in SdrOle2Obj::Connect_Impl() (this=this@entry=0x20734f0) at svx/source/svdraw/svdoole2.cxx:984
#8 0x00007ffff23a6310 in SdrOle2Obj::Init() (this=this@entry=0x20734f0) at svx/source/svdraw/svdoole2.cxx:695
Try to defer that conversion by not doing a
maVectorGraphicData->getReplacement() in ImpGraphic::ImplSetPrefSize(),
rather just store the preferred size and apply it later when
getReplacement() is called.
This helps, because the above OLE-from-PPT case loads the graphic, but
only to export it as SVM, so it doesn't need a vector -> bitmap
conversion otherwise.
Change-Id: I24790c0a3e298d5fbb3faff35d529e79cc72845a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92144
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw/qa')
0 files changed, 0 insertions, 0 deletions