Age | Commit message (Collapse) | Author |
|
ImplCreateSwapInfo changed to createSwapInfo.
Flatten the code body
Change-Id: I5865373d0b7f3cc717a9600bcf6fd198e8320e35
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92947
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
Change-Id: Iec0227b1e1ceebda961e158315ea5e56c2d33204
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92946
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
Change-Id: I882d30f2f27149c865160b3fa68fa974701cea71
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92921
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
Change-Id: I895002aa31380d2b5bc2593e66080f3fc94034e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92920
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
Change-Id: Ida7ecf82d9e54d3a3703b836870534dbf41e51ba
|
|
Change-Id: I49dd552010d008cc486c6aaf51e226cc5bf4a1cb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92908
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
Change-Id: Ie235b6d02582d4d5ee3dc3d9d2be7f022bcb13c4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92906
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
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
|
|
There is no need to hide std::shared_ptr<VectorGraphicData> type
under an alias name. It doesn't make the code more understandble
and it usually is the exact opposite because we know with what
type we are dealing with.
Change-Id: Iec80ee99697ff2fe3a8275fc2787b5370510ebe6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92069
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
Moving PDF to use VectorGraphicData in Graphic has temporary
removed the support for showing different PDF pages when opening
the PDF using pdfium (LO_IMPORT_USE_PDFIUM=1).
This adds the support for back by specifying whcih PDF page to
render when creating the VectorGraphicData (and can't be changd
afterwards), which is used to create a Graphic and contains the
PDF source data array.
Change-Id: Ib915216b8d4c0c063d0fead44ff156b1915a35d2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90562
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
In principle, the current Svg/Emf/Wmf and PDF handling is trying to
achieve the same thing: Keep the original stream untouched, provide a
replacement graphics, and a kind of rendering.
To hold the data, the Svg/Emf/Wmf and PDF were using different structures
though. This commit consolidatates that, and makes the Insert
-> Image... (for PDF) actually using the VectorGraphicData to hold the
original stream.
This breaks loading the PDF as a document via PDFium - I'll fix it in
the next commit(s).
Change-Id: Iac102f32b757390a03438c165e430283851cc10b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90561
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
Change-Id: I0b3b17736a76be290f6e5b77ee547b7e650d4489
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89449
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
Change-Id: I11fdc9a0dcf745dacd516cfc8540a8fb67c45b6c
Reviewed-on: https://gerrit.libreoffice.org/78106
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Reviewed-on: https://gerrit.libreoffice.org/70162
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
(cherry picked from commit d3a9bdd982ad1ed17cb6fef91885fc4dcf442fdb)
Change-Id: Iebd85e5e60c76e6d0756d15e1fa6107a3fcc837d
Reviewed-on: https://gerrit.libreoffice.org/77693
Tested-by: Jenkins
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
|
|
Change-Id: Iff6acef712c5b95c8cc222fc5293c9304b1c03ec
(cherry picked from commit c0a3f61ef5c42d6cfa7484a2c759e7638da2c096)
Reviewed-on: https://gerrit.libreoffice.org/77692
Tested-by: Jenkins
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
|
|
This fixes the destruction of the static cache of the PDF data; without
this, there were already missing uno runtime info.
(cherry picked from commit 20055ebe1b27f716a2acf1f0f4dda2864ae811bf)
Change-Id: I877c9ccf96c4b7eabf3d643e17f324d86d987f94
Reviewed-on: https://gerrit.libreoffice.org/77691
Tested-by: Jenkins
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
|
|
This should enable using move semantics where possible e.g. in standard
containers.
According to https://en.cppreference.com/w/cpp/language/move_constructor:
To make strong exception guarantee possible, user-defined move
constructors should not throw exceptions. For example, std::vector
relies on std::move_if_noexcept to choose between move and copy
when the elements need to be relocated.
Change-Id: I6e1e1cdd5cd430b139ffa2fa7031fb0bb625decb
Reviewed-on: https://gerrit.libreoffice.org/77957
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
|
|
Change-Id: I20545527b117c9562b91076b748fb3e2659d2497
Reviewed-on: https://gerrit.libreoffice.org/77944
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Platform-specific subdirs are left alone:
android, ios, osx, quartz, win
Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.
Change-Id: Icbb906b7fbc960240c73c56d3dae2a78b06a0f53
Reviewed-on: https://gerrit.libreoffice.org/73754
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
|
|
Regression from commit 69b62cfcbd364d7f62142149c2f690104b217ca1
(tdf#125281 DOC import: fix size of lazy-loaded metafiles, 2019-05-27),
the problem is that setting the preferred size of a Graphic swaps it in.
Avoid this by extending ImportUnloadedGraphic(): if a size hint is
provided, then that will be used instead of info from the graphic
descriptor (which is usually only meaningful for bitmaps).
This way we maintain the correct size and we're back to lazy-loading
metafiles from binary MSO files as well.
Change-Id: Ide12d12166110e98ea47b5347dd24fb203b22da3
Reviewed-on: https://gerrit.libreoffice.org/73798
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
|
|
The problem here is that we never actually hit the maExportGraphics
cache in SvXMLGraphicHelper, even though we are passing the same image
down repeatedly.
There are two bugs here:
(1) BitmapEx::operator== does not return true if we instantiate 2
Graphic objects from the same XGraphic, so change it to use the more
expensive operator==. To mitigate the cost, move the expensive checks to
the bottom of the method.
(2) in order to use an object in std::unordered_map, the object must
implement an equality function and a hash function. If two objects are
equal THEY MUST have the same hash value. Using the Impl* as the hash
value does not satisfy that condition, so rather use the checksum, which
does.
After these fixes, the save time drops to less than a second.
Also make the checksum method look more like the operator== method,
and add a checksum calculation method for SVG data that more accurately
reflects the underlying SVG data.
Change-Id: I4ca0c7bee60b2efa6fe42301e582c7b278022b46
Reviewed-on: https://gerrit.libreoffice.org/72615
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.
Change-Id: If1b2e04872eb0dd6725802c1709a9085f4cd8c91
Reviewed-on: https://gerrit.libreoffice.org/64141
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
|
|
When importing PDF as images, we store the
PDF stream in the GfxLink. For large PDFs
storing a copy of the full PDF with each
page is overkill. For example a 10MB PDF
with 200 pages will consume 2GB of memory!
Change-Id: I99913514cf5c562683080bc817668095bee69427
Reviewed-on: https://gerrit.libreoffice.org/55571
Tested-by: Jenkins
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
|
|
Change-Id: I26a0da1ec9cda9030371977596053a45303756a0
Reviewed-on: https://gerrit.libreoffice.org/55609
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: I1bb3fa7d44d5f92df2bb8c4ed4b85ccd984c2617
|
|
LOK now opens PDFs as images using Pdfium,
which has a superior accuracy and support
to poppler, the default pdf reader.
Change-Id: Ifbbecf7f048f001836fb98886705cba47e6bed4e
|
|
Change-Id: I8146aa4e206788afff71142e1877fd7a885f4652
|
|
Change-Id: I785e96599bbda029adf4698d11d7f981750dec07
Reviewed-on: https://gerrit.libreoffice.org/54802
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
This change has multiple parts:
- Move "BulletAsImage" test from ODT only to globalfilter and
run it on ODT, DOC, DOCX, RTF formats and extend checks of
the XGraphic used for the bullets and the size.
- Check if GIF is animated as we need to know this in unloaded
graphic or bullets aren't rendered correctly if we assume
they are animated.
- Use "Graphic" property in writerfilter to get the graphic from
a XShape and not the "Bitmap" property which returns a Graphic
as a MetaFile and not the original Graphic.
- Make sure "GraphicBitmap" is filled with XBitmap and not with
XGraphic.
- Change "testFDO74215" to use the expected bullet size as it
is in the original document. Looks like the initial bug was
just asserting the bullet size is set to a value (non-zero).
Change-Id: I6b151c0bf9f426669e07522f0fc699fbb652046b
Reviewed-on: https://gerrit.libreoffice.org/54477
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
It's easier to fix this centrally in vcl, rather than not calling
GetSizePixel() in each and every import filter.
Change-Id: Ie0a788b8a5b886ebc2fedf0dc052deb4149b9364
Reviewed-on: https://gerrit.libreoffice.org/53333
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
|
|
When a document is loaded it takes a lot of time and memory to
load the graphic that are in the documet, so avoid that and just
store the compressed graphic into a temporary file (handeled by
GfxLink) and load when we really need to show the graphic.
GraphicObject cached some attributes from Graphic, but this
attributes now aren't available immediately so this attributes
are removed form GraphicObject and now delegate to the Graphic
itself. GetSizeBytes attribute however was removed as it is
only used in some tests.
GfxLink initial values were moved to the constructor and are
not set in the header file anymore (as it is the recommended
way to do it).
The SdImportTest::testDocumentLayout failed as it looks like the
dump sometimes didn't include the width and height of the null
bitmap (which is set to 32x32) of the FillBitmap in some
situations, but then in other situations it did include this
attributes. With this change the width and height are always
included for the FillBitmap which looks like it is more correct.
Change-Id: Ia1218f93b1735402b7828404f65660e2d4acf32f
Reviewed-on: https://gerrit.libreoffice.org/53016
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
Change-Id: I3d1b88dbd0ff73fddc08d52f50e0efb42daab89b
Reviewed-on: https://gerrit.libreoffice.org/52756
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
This adds vcl::graphic::Manager which is a manager singleton that
tracks all the creation fo graphic objects and swaps them out on
a time and allocation basis.
Time based - every number of seconds it looks for Graphics that
weren't used for a time.
Allocation based - when creating a new Graphic and the total of
Graphic uses more than the total amount of memory for Graphics
defined in configuration, it tries to release the Graphics that
weren't used for a time.
Change-Id: I5dbf74db4a6455d32c4abcbad7be21c7f0534642
Reviewed-on: https://gerrit.libreoffice.org/52396
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
We need strict control when PDFData and VectorGraphicData is
accessed and changed, so create access methods for PDFData and
move the access methods to cxx (for VectorGraphicData).
Change-Id: I39324a807a4db559bad5501b5913e62a0aeabf01
Reviewed-on: https://gerrit.libreoffice.org/52395
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
Change-Id: Idb0796bfb3da1695bcd7fafcd9608dc336c30196
Reviewed-on: https://gerrit.libreoffice.org/52394
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
For now just introduce the GraphicExternalLink internally in
ImpGraphic, and use it for the origin URL. In a future patch this
will store additional data about the link.
Change-Id: I7b4edac80d0e71603d37243ff28bcac1b18fdc01
Reviewed-on: https://gerrit.libreoffice.org/52393
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
Also remove some GraphicObjectTest because they call into
GraphicManager which now doesn't exist anymore.
Change-Id: Ia434736d8611df629af3e897c878a7fb8bbe4706
Reviewed-on: https://gerrit.libreoffice.org/52243
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
Change-Id: I73e7377c2049211de0b464efff03058dc5de33a6
Reviewed-on: https://gerrit.libreoffice.org/49554
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
all this foo is ultimately animated gifs and the count there is
limited to unsigned 16bit
Change-Id: Ib6e6dde7355f3619bb7735743e686e6338a235ee
|
|
First steps to organize an importer that can read/interpret
wmf/emf/emf+ and deliver a primitive representation for
the content by parsing it. Use the same mechanisms as
already applied for Svg, so to reuse abilities to keep
original binary data to allow save again and embedding in
files and have an implemented replacement bitmap based
representation. For this, unify the used helper classes
to handle more than just Svg. For 1st try, add test code
and static bool switches
Change-Id: I6e0a82943541d811a8f8d65a84115569fcd8cee7
|
|
Split the import into two:
1) Just create the bitmap, this part is not thread-safe (e.g.
OpenGLContext::makeCurrent() is called when OpenGL is enabled).
2) Import the image into an existing bitmap.
The point is that the second part takes much more time than the first,
and in the future that part may be executed on a thread, while without
such a split the whole ImportJPEG() can't do that. For now
GraphicFilter::ImportGraphic() simply invokes the two parts after each
other, so no real functional changes yet.
Change-Id: Iee742a2cd3c581aeaf1a1ed9f55cd543955a85e0
Reviewed-on: https://gerrit.libreoffice.org/37397
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
|
|
Change-Id: I0dec3e192f3da895398a8b011c0e7275aab59d73
|
|
seems to me that this hackery is to avoid the swapfile
getting pulled out from underneath it during swapin
Change-Id: I6b58d7e31731db8edc4026460beabc667204dcae
Reviewed-on: https://gerrit.libreoffice.org/33620
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
|
|
Change-Id: Iab449967c70a55c03c3e6b95de8e7d973cb68089
|
|
Change-Id: I2e251ff71b1f20e43c797c3fc901f3a70dce7c6c
|
|
Change-Id: Ifa8bfafb2e527ce5976f3bd310d107cb2840a5f6
Reviewed-on: https://gerrit.libreoffice.org/30531
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: I41ea7bf672040089ccca5cf2bc449a0d0e78b903
Reviewed-on: https://gerrit.libreoffice.org/29219
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
|
|
find methods with default params with only zero or one call site
Change-Id: Ie5b30f60e9fe00ba1acf0dfc79b005ded46f05a0
Reviewed-on: https://gerrit.libreoffice.org/27512
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
|
|
Change-Id: I51c3995f4a6e940a5235524eb94dd356b27ae8d7
Reviewed-on: https://gerrit.libreoffice.org/26955
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
|
|
Change-Id: I74eb2347970ef19f7a215b86bfeae9945c07dbea
Reviewed-on: https://gerrit.libreoffice.org/26889
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
|