diff options
-rw-r--r-- | include/vcl/BinaryDataContainer.hxx | 3 | ||||
-rw-r--r-- | include/vcl/gfxlink.hxx | 3 | ||||
-rw-r--r-- | vcl/source/gdi/impgraph.cxx | 5 | ||||
-rw-r--r-- | vcl/source/graphic/BinaryDataContainer.cxx | 2 |
4 files changed, 13 insertions, 0 deletions
diff --git a/include/vcl/BinaryDataContainer.hxx b/include/vcl/BinaryDataContainer.hxx index e9e46a04e667..e178ad6c4d62 100644 --- a/include/vcl/BinaryDataContainer.hxx +++ b/include/vcl/BinaryDataContainer.hxx @@ -53,6 +53,9 @@ public: /// writes the contents to the given stream std::size_t writeToStream(SvStream& rStream) const; + /// return the in-memory size in bytes as of now. + std::size_t getSizeBytes() const; + size_t calculateHash() const; }; diff --git a/include/vcl/gfxlink.hxx b/include/vcl/gfxlink.hxx index 8c0f5fd32b05..531633b3f738 100644 --- a/include/vcl/gfxlink.hxx +++ b/include/vcl/gfxlink.hxx @@ -85,6 +85,9 @@ public: sal_uInt32 GetDataSize() const { return maDataContainer.getSize(); } const sal_uInt8* GetData() const; + /// return the in-memory size as of now. + size_t getSizeBytes() const { return maDataContainer.getSizeBytes(); } + const BinaryDataContainer& getDataContainer() const { return maDataContainer; diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index 84df1765569c..76598c9945e1 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -999,6 +999,9 @@ sal_uLong ImpGraphic::getSizeBytes() const break; } + if (mpGfxLink) + mnSizeBytes += mpGfxLink->getSizeBytes(); + return mnSizeBytes; } @@ -1431,6 +1434,8 @@ void ImpGraphic::dumpState(rtl::OStringBuffer &rState) rState.append(static_cast<sal_Int32>(meType)); rState.append("\tsize:\t"); rState.append(static_cast<sal_Int64>(mnSizeBytes)); + rState.append("\tgfxl:\t"); + rState.append(static_cast<sal_Int64>(mpGfxLink ? mpGfxLink->getSizeBytes() : -1)); rState.append("\t"); rState.append(static_cast<sal_Int32>(maSwapInfo.maSizePixel.Width())); rState.append("x"); diff --git a/vcl/source/graphic/BinaryDataContainer.cxx b/vcl/source/graphic/BinaryDataContainer.cxx index b35195b7d27e..31561d9e16e3 100644 --- a/vcl/source/graphic/BinaryDataContainer.cxx +++ b/vcl/source/graphic/BinaryDataContainer.cxx @@ -74,6 +74,8 @@ std::size_t BinaryDataContainer::writeToStream(SvStream& rStream) const size_t BinaryDataContainer::getSize() const { return mpData ? mpData->size() : 0; } +size_t BinaryDataContainer::getSizeBytes() const { return getSize(); } + bool BinaryDataContainer::isEmpty() const { return !mpData || mpData->empty(); } const sal_uInt8* BinaryDataContainer::getData() const { return mpData ? mpData->data() : nullptr; } |