summaryrefslogtreecommitdiff
path: root/drawinglayer/source/primitive2d/baseprimitive2d.cxx
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-11-07 15:09:31 +0100
committerMichael Stahl <mstahl@redhat.com>2016-11-07 18:52:22 +0000
commitf9028f1945e3ad87cda1b3001611632b1b424467 (patch)
treeb73f41f935c72df09e3c395a29dcb6eab50874fb /drawinglayer/source/primitive2d/baseprimitive2d.cxx
parent04644956e53d81cc4518fdbb22ddfe4fd9b8aaf7 (diff)
vcl: improve accounting of SVG images in graphics cache
The problem is that the graphics cache only counts the size of the SVG text, which is stored in SvgData::maSvgDataArray. However the SvgData::maSequence may use a lot more memory, as it may contain de-compressed bitmaps that are stored as base64-encoded PNGs in the SVG text. For example icon-themes/galaxy/brand/flat_logo.svg is 812 Ko but contains 60 Mo of bitmaps. This may cause excessive memory usage and failure to export documents due to OOM; according to valgrind massif, the bitmap buffers use 90% of the heap. Add a new interface com::sun::star::util::XAccounting, and implement it in drawinglayer BasePrimitive2D. VCL SvgData can't access drawinglayer via C++ directly so this looks like the best approach. Change-Id: I5a7c3147733e23473c1decabed24c1f79d951c7d Reviewed-on: https://gerrit.libreoffice.org/30669 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'drawinglayer/source/primitive2d/baseprimitive2d.cxx')
-rw-r--r--drawinglayer/source/primitive2d/baseprimitive2d.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/drawinglayer/source/primitive2d/baseprimitive2d.cxx b/drawinglayer/source/primitive2d/baseprimitive2d.cxx
index 6f89cf3b9358..84833c36966a 100644
--- a/drawinglayer/source/primitive2d/baseprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/baseprimitive2d.cxx
@@ -71,6 +71,12 @@ namespace drawinglayer
const geometry::ViewInformation2D aViewInformation(rViewParameters);
return basegfx::unotools::rectangle2DFromB2DRectangle(getB2DRange(aViewInformation));
}
+
+ sal_Int64 SAL_CALL BasePrimitive2D::estimateUsage()
+ throw (css::uno::RuntimeException)
+ {
+ return 0; // for now ignore the objects themselves
+ }
} // end of namespace primitive2d
} // end of namespace drawinglayer