Kaydet (Commit) 6143a7ee authored tarafından Stephan Bergmann's avatar Stephan Bergmann

GlyphCachePeer::mnBytesUsed is always zero

...at least since 1c064d14 "I don't see that any
of this makes sense anymore" removed the last uses of it from
X11GlyphPeer::RemovingGlyph.

Change-Id: Ic8c879ac6023a1e796da220dd61dc33750aaad60
üst 0feaf0d6
...@@ -223,8 +223,7 @@ void GlyphCache::UncacheFont( ServerFont& rServerFont ) ...@@ -223,8 +223,7 @@ void GlyphCache::UncacheFont( ServerFont& rServerFont )
// user who wants to release it only got const ServerFonts. // user who wants to release it only got const ServerFonts.
// The caching algorithm needs a non-const object // The caching algorithm needs a non-const object
ServerFont* pFont = const_cast<ServerFont*>( &rServerFont ); ServerFont* pFont = const_cast<ServerFont*>( &rServerFont );
if( (pFont->Release() <= 0) if( (pFont->Release() <= 0) && (mnMaxSize <= mnBytesUsed) )
&& (mnMaxSize <= (mnBytesUsed + mrPeer.GetByteCount())) )
{ {
mpCurrentGCFont = pFont; mpCurrentGCFont = pFont;
GarbageCollect(); GarbageCollect();
...@@ -296,7 +295,7 @@ inline void GlyphCache::AddedGlyph( ServerFont& rServerFont, GlyphData& rGlyphDa ...@@ -296,7 +295,7 @@ inline void GlyphCache::AddedGlyph( ServerFont& rServerFont, GlyphData& rGlyphDa
void GlyphCache::GrowNotify() void GlyphCache::GrowNotify()
{ {
if( (mnBytesUsed + mrPeer.GetByteCount()) > mnMaxSize ) if( mnBytesUsed > mnMaxSize )
GarbageCollect(); GarbageCollect();
} }
......
...@@ -322,16 +322,12 @@ public: ...@@ -322,16 +322,12 @@ public:
class GlyphCachePeer class GlyphCachePeer
{ {
protected: protected:
GlyphCachePeer() : mnBytesUsed(0) {} GlyphCachePeer() {}
virtual ~GlyphCachePeer() {} virtual ~GlyphCachePeer() {}
public: public:
sal_Int32 GetByteCount() const { return mnBytesUsed; }
virtual void RemovingFont( ServerFont& ) {} virtual void RemovingFont( ServerFont& ) {}
virtual void RemovingGlyph( GlyphData& ) {} virtual void RemovingGlyph( GlyphData& ) {}
protected:
sal_Int32 mnBytesUsed;
}; };
class VCL_DLLPUBLIC RawBitmap class VCL_DLLPUBLIC RawBitmap
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment