summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-08-29 17:50:44 +0200
committerStephan Bergmann <sbergman@redhat.com>2016-08-29 17:50:44 +0200
commit66e2f20c5610eb500b4a9cf22ef024492ba0fd00 (patch)
tree057c5018430402d5f9fcd17a3a7e06b780008c0c
parent698153d9096f705cc5e16e8ae6fc0ebd9210c79d (diff)
CairoFontsCache is only used in cairotextrender.cxx
...so move it there and remove the VCL_DLLPUBLIC Change-Id: I1fc75984f8a9935e34cd9ac36d878809b538bd1e
-rw-r--r--vcl/inc/unx/cairotextrender.hxx30
-rw-r--r--vcl/unx/generic/gdi/cairotextrender.cxx38
2 files changed, 36 insertions, 32 deletions
diff --git a/vcl/inc/unx/cairotextrender.hxx b/vcl/inc/unx/cairotextrender.hxx
index 1e2eb9cc6b18..8c678135535e 100644
--- a/vcl/inc/unx/cairotextrender.hxx
+++ b/vcl/inc/unx/cairotextrender.hxx
@@ -26,40 +26,10 @@
#include <deque>
-typedef struct FT_FaceRec_* FT_Face;
-
class ServerFont;
class GlyphCache;
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
{
ServerFont* mpServerFont[ MAX_FALLBACK ];
diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx b/vcl/unx/generic/gdi/cairotextrender.cxx
index d1ad18091d93..d86539354fb4 100644
--- a/vcl/unx/generic/gdi/cairotextrender.cxx
+++ b/vcl/unx/generic/gdi/cairotextrender.cxx
@@ -43,6 +43,42 @@
#include <cairo.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()
: mnTextColor(MAKE_SALCOLOR(0x00, 0x00, 0x00)) //black
{
@@ -118,8 +154,6 @@ void ServerFontInstance::HandleFontOptions()
mpServerFont->SetFontOptions(mxFontOptions);
}
-CairoFontsCache::LRUFonts CairoFontsCache::maLRUFonts;
-
void CairoFontsCache::CacheFont(void *pFont, const CairoFontsCache::CacheId &rId)
{
maLRUFonts.push_front( std::pair<void*, CairoFontsCache::CacheId>(pFont, rId) );