0026d3c...
by
Ashod Nakashian <email address hidden>
vcl: share GfxLink
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!
1e47e0a...
by
=?utf-8?q?Toma=C5=BE_Vajngerl?= <email address hidden>
Function to load graphic swapped out (loaded on demand)
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.
Reviewed-on: https://gerrit.libreoffice.org/53016
Tested-by: Jenkins <email address hidden>
Reviewed-by: Tomaž Vajngerl <email address hidden>
(cherry picked from commit 7b355669c6ddeab2e6cec692d6afdff41c61d0fb)
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.
636f44b...
by
=?utf-8?q?Toma=C5=BE_Vajngerl?= <email address hidden>
vcl: Add a internal (memory) manager for Graphic objects
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.
Reviewed-on: https://gerrit.libreoffice.org/52396
Tested-by: Jenkins <email address hidden>
Reviewed-by: Tomaž Vajngerl <email address hidden>
(cherry picked from commit a2b53fece14f745853bcfe1a300c3dceb580e148)
80d57f9...
by
=?utf-8?q?Toma=C5=BE_Vajngerl?= <email address hidden>
Move (and rename) graphic stuff from svtools to vcl
This is preparing to change how GraphicManager works where it
won't base itself around GraphicObject anymore but Graphic. No
functional or cosmetic change was made to the classes, only
changes that were needed because of the move and rename.
The only thing that wasn't moved is the GraphicRenderer as it
is not needed in vcl for now (but makes sense to move it in the
future to keep graphic stuff together).
grfmgr was renamed to GraphicObject as the GraphicManager will be
changed a lot and most likely moved out, so the name grfmgr won't
make any sense anymore.
All the UNO implementations were renamed with a prefix Uno and
used the same name as the class name. This is made to be more
specific which are the Uno objects (for example graphic.cxx
contained the implementation of XGraphic, which is similar to
graph.cxx contains Graphic).
Reviewed-on: https://gerrit.libreoffice.org/51068
Tested-by: Jenkins <email address hidden>
Reviewed-by: Tomaž Vajngerl <email address hidden>
(cherry picked from commit 7fbb96c2fbf99c47eca6f493f54fc3974f55cf86)