diff options
Diffstat (limited to 'libs/hwui/FontRenderer.h')
-rw-r--r-- | libs/hwui/FontRenderer.h | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/libs/hwui/FontRenderer.h b/libs/hwui/FontRenderer.h index 1da3b6c..307a1d9 100644 --- a/libs/hwui/FontRenderer.h +++ b/libs/hwui/FontRenderer.h @@ -61,11 +61,13 @@ public: void setFont(SkPaint* paint, const mat4& matrix); void precache(SkPaint* paint, const char* text, int numGlyphs, const mat4& matrix); + void endPrecaching(); // 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, - Functor* functor); + Functor* functor, bool forceFinish = true); + // bounds is an out parameter bool renderTextOnPath(SkPaint* paint, const Rect* clip, const char *text, uint32_t startIndex, uint32_t len, int numGlyphs, SkPath* path, float hOffset, float vOffset, Rect* bounds); @@ -95,20 +97,13 @@ public: mLinearFiltering = linearFiltering; } - uint32_t getCacheSize() const { - uint32_t size = 0; - for (uint32_t i = 0; i < mCacheTextures.size(); i++) { - CacheTexture* cacheTexture = mCacheTextures[i]; - if (cacheTexture && cacheTexture->getTexture()) { - size += cacheTexture->getWidth() * cacheTexture->getHeight(); - } - } - return size; - } + uint32_t getCacheSize() const; private: friend class Font; + static const uint32_t gMaxNumberOfQuads = 2048; + const uint8_t* mGammaTable; void allocateTextureMemory(CacheTexture* cacheTexture); @@ -162,7 +157,6 @@ private: bool mUploadTexture; - uint32_t mMaxNumberOfQuads; uint32_t mIndexBufferID; Functor* mFunctor; |