diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2021-01-02 00:12:25 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2021-01-22 07:49:17 +0100 |
commit | 3adff41ab14ab27ca07cffef0f38471ac5321ee2 (patch) | |
tree | cfac8579a99a9bccc4c0f8c2f9ef37e5418507ff /vcl/source/graphic | |
parent | 4cde10d255ce9741ca8ea115078b104dc4d67057 (diff) |
vcl: support creating a Graphic with only GfxLink as swapped-out
This adds support to create a Graphic with only a GfxLink and the
Graphic is in a swapped-out state. This is similar to the prepared
state, but the prepared state is a special state of the Graphic.
In the future, all loading will probably be done in this way and
prepared state will go away, but for now this is only supported
for PDF and is used in PDFium import only.
The main reason is to avoid that a multi-page PDF is immediately
swapped out after loading, which just does unneeded work and
freezes the application for a while.
Change-Id: I409741d27a4ad309264cdf27b2ba03f2cf37ead9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109600
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl/source/graphic')
-rw-r--r-- | vcl/source/graphic/Manager.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/vcl/source/graphic/Manager.cxx b/vcl/source/graphic/Manager.cxx index fafca90b5ad8..054a615ef812 100644 --- a/vcl/source/graphic/Manager.cxx +++ b/vcl/source/graphic/Manager.cxx @@ -203,6 +203,14 @@ std::shared_ptr<ImpGraphic> Manager::newInstance() return pReturn; } +std::shared_ptr<ImpGraphic> Manager::newInstance(std::shared_ptr<GfxLink> const& rGfxLink, + sal_Int32 nPageIndex) +{ + auto pReturn = std::make_shared<ImpGraphic>(rGfxLink, nPageIndex); + registerGraphic(pReturn); + return pReturn; +} + std::shared_ptr<ImpGraphic> Manager::newInstance(const BitmapEx& rBitmapEx) { auto pReturn = std::make_shared<ImpGraphic>(rBitmapEx); |