Kaydet (Commit) 66e2f20c authored tarafından Stephan Bergmann's avatar Stephan Bergmann

CairoFontsCache is only used in cairotextrender.cxx

...so move it there and remove the VCL_DLLPUBLIC

Change-Id: I1fc75984f8a9935e34cd9ac36d878809b538bd1e
üst 698153d9
...@@ -26,40 +26,10 @@ ...@@ -26,40 +26,10 @@
#include <deque> #include <deque>
typedef struct FT_FaceRec_* FT_Face;
class ServerFont; class ServerFont;
class GlyphCache; class GlyphCache;
typedef struct _cairo cairo_t; typedef struct _cairo cairo_t;
class VCL_DLLPUBLIC CairoFontsCache
{
public:
struct CacheId
{
FT_Face maFace;
const void *mpOptions;
bool mbEmbolden;
bool mbVerticalMetrics;
bool operator ==(const CacheId& rOther) const
{
return maFace == rOther.maFace &&
mpOptions == rOther.mpOptions &&
mbEmbolden == rOther.mbEmbolden &&
mbVerticalMetrics == rOther.mbVerticalMetrics;
}
};
private:
typedef std::deque< std::pair<void *, CacheId> > LRUFonts;
static LRUFonts maLRUFonts;
public:
CairoFontsCache() = delete;
static void CacheFont(void *pFont, const CacheId &rId);
static void* FindCachedFont(const CacheId &rId);
};
class VCL_DLLPUBLIC CairoTextRender : public TextRenderImpl class VCL_DLLPUBLIC CairoTextRender : public TextRenderImpl
{ {
ServerFont* mpServerFont[ MAX_FALLBACK ]; ServerFont* mpServerFont[ MAX_FALLBACK ];
......
...@@ -43,6 +43,42 @@ ...@@ -43,6 +43,42 @@
#include <cairo.h> #include <cairo.h>
#include <cairo-ft.h> #include <cairo-ft.h>
namespace {
typedef struct FT_FaceRec_* FT_Face;
class CairoFontsCache
{
public:
struct CacheId
{
FT_Face maFace;
const void *mpOptions;
bool mbEmbolden;
bool mbVerticalMetrics;
bool operator ==(const CacheId& rOther) const
{
return maFace == rOther.maFace &&
mpOptions == rOther.mpOptions &&
mbEmbolden == rOther.mbEmbolden &&
mbVerticalMetrics == rOther.mbVerticalMetrics;
}
};
private:
typedef std::deque< std::pair<void *, CacheId> > LRUFonts;
static LRUFonts maLRUFonts;
public:
CairoFontsCache() = delete;
static void CacheFont(void *pFont, const CacheId &rId);
static void* FindCachedFont(const CacheId &rId);
};
CairoFontsCache::LRUFonts CairoFontsCache::maLRUFonts;
}
CairoTextRender::CairoTextRender() CairoTextRender::CairoTextRender()
: mnTextColor(MAKE_SALCOLOR(0x00, 0x00, 0x00)) //black : mnTextColor(MAKE_SALCOLOR(0x00, 0x00, 0x00)) //black
{ {
...@@ -118,8 +154,6 @@ void ServerFontInstance::HandleFontOptions() ...@@ -118,8 +154,6 @@ void ServerFontInstance::HandleFontOptions()
mpServerFont->SetFontOptions(mxFontOptions); mpServerFont->SetFontOptions(mxFontOptions);
} }
CairoFontsCache::LRUFonts CairoFontsCache::maLRUFonts;
void CairoFontsCache::CacheFont(void *pFont, const CairoFontsCache::CacheId &rId) void CairoFontsCache::CacheFont(void *pFont, const CairoFontsCache::CacheId &rId)
{ {
maLRUFonts.push_front( std::pair<void*, CairoFontsCache::CacheId>(pFont, rId) ); maLRUFonts.push_front( std::pair<void*, CairoFontsCache::CacheId>(pFont, rId) );
......
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