diff options
author | Romain Guy <romainguy@google.com> | 2013-01-08 11:15:30 -0800 |
---|---|---|
committer | Romain Guy <romainguy@google.com> | 2013-01-08 15:21:42 -0800 |
commit | e3a9b24b5e3f9b2058486814a6d27729e51ad466 (patch) | |
tree | 17830a6fd61c286854cebb07638d3c2dea6277cd /libs/hwui/FontRenderer.h | |
parent | 5b4628aeeaa0462cd99256d28b636c06b1845930 (diff) | |
download | frameworks_base-e3a9b24b5e3f9b2058486814a6d27729e51ad466.zip frameworks_base-e3a9b24b5e3f9b2058486814a6d27729e51ad466.tar.gz frameworks_base-e3a9b24b5e3f9b2058486814a6d27729e51ad466.tar.bz2 |
Add plumbing for better text scaling
Fonts are now described by a transform matrix. This lead to switching
from a vector to a hashmap. This change therefore adds new comparators
and hash computations to Font.
Change-Id: I2daffa7d6287c18554c606b8bfa06640d28b4530
Diffstat (limited to 'libs/hwui/FontRenderer.h')
-rw-r--r-- | libs/hwui/FontRenderer.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/libs/hwui/FontRenderer.h b/libs/hwui/FontRenderer.h index 09a3c25..3964bca 100644 --- a/libs/hwui/FontRenderer.h +++ b/libs/hwui/FontRenderer.h @@ -17,6 +17,7 @@ #ifndef ANDROID_HWUI_FONT_RENDERER_H #define ANDROID_HWUI_FONT_RENDERER_H +#include <utils/LruCache.h> #include <utils/Vector.h> #include <SkPaint.h> @@ -27,6 +28,7 @@ #include "font/CacheTexture.h" #include "font/CachedGlyphInfo.h" #include "font/Font.h" +#include "Matrix.h" #include "Properties.h" namespace android { @@ -47,14 +49,11 @@ public: mGammaTable = gammaTable; } - void setFont(SkPaint* paint, uint32_t fontId, float fontSize); + void setFont(SkPaint* paint, const mat4& matrix); - void precache(SkPaint* paint, const char* text, int numGlyphs); + void precache(SkPaint* paint, const char* text, int numGlyphs, const mat4& matrix); // bounds is an out parameter - bool renderText(SkPaint* paint, const Rect* clip, const char *text, uint32_t startIndex, - uint32_t len, int numGlyphs, int x, int y, Rect* bounds); - // bounds is an out parameter bool renderPosText(SkPaint* paint, const Rect* clip, const char *text, uint32_t startIndex, uint32_t len, int numGlyphs, int x, int y, const float* positions, Rect* bounds); // bounds is an out parameter @@ -153,7 +152,7 @@ private: Vector<CacheTexture*> mCacheTextures; Font* mCurrentFont; - Vector<Font*> mActiveFonts; + LruCache<Font::FontDescription, Font*> mActiveFonts; CacheTexture* mCurrentCacheTexture; |