summaryrefslogtreecommitdiff
path: root/vcl/inc/generic
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-07-12 18:51:26 +0200
committerStephan Bergmann <sbergman@redhat.com>2013-07-12 18:51:26 +0200
commitdd547e4a8c1895aa89e699810323c933d9ac415b (patch)
tree4419e9d099ac6f9199d916aa1ba764e3c7c52cec /vcl/inc/generic
parent333b7fb38153ae90bcbcc1348c8db698ba207331 (diff)
Fix headless mode glyph cache memory handling
...the original code was riddled with errors. It leaked memory, which if it didn't it would have deleted multiple times. Change-Id: Ic70b425fac02ef894e35b3dc15039d217f8870f5
Diffstat (limited to 'vcl/inc/generic')
-rw-r--r--vcl/inc/generic/glyphcache.hxx27
1 files changed, 7 insertions, 20 deletions
diff --git a/vcl/inc/generic/glyphcache.hxx b/vcl/inc/generic/glyphcache.hxx
index 1457dd52dd3a..d33aee125053 100644
--- a/vcl/inc/generic/glyphcache.hxx
+++ b/vcl/inc/generic/glyphcache.hxx
@@ -34,6 +34,7 @@ struct ImplKernPairData;
class ImplFontOptions;
#include <tools/gen.hxx>
+#include <basebmp/bitmapdevice.hxx>
#include <boost/unordered_map.hpp>
#include <boost/unordered_set.hpp>
#include <boost/shared_ptr.hpp>
@@ -90,7 +91,7 @@ private:
friend class ServerFont;
// used by ServerFont class only
void AddedGlyph( ServerFont&, GlyphData& );
- void RemovingGlyph( ServerFont&, GlyphData&, int nGlyphIndex );
+ void RemovingGlyph( GlyphData& );
void UsingGlyph( ServerFont&, GlyphData& );
void GrowNotify();
@@ -139,7 +140,9 @@ private:
// -----------------------------------------------------------------------
// the glyph specific data needed by a GlyphCachePeer is usually trivial,
-// not attaching it to the corresponding GlyphData would be overkill
+// not attaching it to the corresponding GlyphData would be overkill;
+// this is currently only used by the headless (aka svp) plugin, where meInfo is
+// basebmp::Format and mpData is SvpGcpHelper*
struct ExtGlyphData
{
int meInfo;
@@ -219,10 +222,6 @@ public:
bool GetGlyphBitmap1( int nGlyphIndex, RawBitmap& ) const;
bool GetGlyphBitmap8( int nGlyphIndex, RawBitmap& ) const;
- void SetExtended( int nInfo, void* ppVoid );
- int GetExtInfo() { return mnExtInfo; }
- void* GetExtPointer() { return mpExtData; }
-
private:
friend class GlyphCache;
friend class ServerFontLayout;
@@ -248,10 +247,6 @@ private:
const FontSelectPattern maFontSelData;
- // info for GlyphcachePeer
- int mnExtInfo;
- void* mpExtData;
-
// used by GlyphCache for cache LRU algorithm
mutable long mnRefCount;
mutable sal_uLong mnBytesUsed;
@@ -351,7 +346,7 @@ protected:
public:
sal_Int32 GetByteCount() const { return mnBytesUsed; }
virtual void RemovingFont( ServerFont& ) {}
- virtual void RemovingGlyph( ServerFont&, GlyphData&, int ) {}
+ virtual void RemovingGlyph( GlyphData& ) {}
protected:
sal_Int32 mnBytesUsed;
@@ -367,7 +362,7 @@ public:
bool Rotate( int nAngle );
public:
- unsigned char* mpBits;
+ basebmp::RawMemorySharedArray mpBits;
sal_uLong mnAllocated;
sal_uLong mnWidth;
@@ -382,14 +377,6 @@ public:
// =======================================================================
-inline void ServerFont::SetExtended( int nInfo, void* pVoid )
-{
- mnExtInfo = nInfo;
- mpExtData = pVoid;
-}
-
-// =======================================================================
-
// ExtraKernInfo allows an on-demand query of extra kerning info #i29881#
// The kerning values have to be scaled to match the font size before use
class VCL_DLLPUBLIC ExtraKernInfo