diff options
| author | 2013-03-20 16:31:12 -0700 | |
|---|---|---|
| committer | 2013-03-20 16:35:05 -0700 | |
| commit | 257ae3502cfad43df681b1783528d645bdabc63f (patch) | |
| tree | e257e21ddf04c544b0dbb6467d2d10a7c659ac1d /libs/hwui/FontRenderer.h | |
| parent | 10c4d99f04a399c78529d0ae66c1785b26a125c3 (diff) | |
Optimize text GL setup
Only performs the GL setup steps when at least one glyph is drawn.
This change also skips various draw operations when the specified
paint draws with alpha = 0.
Change-Id: I9eda148b0503acffc552ee19196f5d52e958a1a2
Diffstat (limited to 'libs/hwui/FontRenderer.h')
| -rw-r--r-- | libs/hwui/FontRenderer.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/libs/hwui/FontRenderer.h b/libs/hwui/FontRenderer.h index 080cc713b0a6..1da3b6cb3433 100644 --- a/libs/hwui/FontRenderer.h +++ b/libs/hwui/FontRenderer.h @@ -38,6 +38,8 @@ namespace RSC { class ScriptIntrinsicBlur; } +class Functor; + namespace android { namespace uirenderer { @@ -62,7 +64,8 @@ public: // 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); + uint32_t len, int numGlyphs, int x, int y, const float* positions, Rect* bounds, + Functor* functor); // 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); @@ -88,13 +91,8 @@ public: DropShadow renderDropShadow(SkPaint* paint, const char *text, uint32_t startIndex, uint32_t len, int numGlyphs, uint32_t radius, const float* positions); - GLuint getTexture(bool linearFiltering = false) { - checkInit(); - - mCurrentCacheTexture->setLinearFiltering(linearFiltering); + void setTextureFiltering(bool linearFiltering) { mLinearFiltering = linearFiltering; - - return mCurrentCacheTexture->getTextureId(); } uint32_t getCacheSize() const { @@ -125,7 +123,7 @@ private: void initVertexArrayBuffers(); void checkInit(); - void initRender(const Rect* clip, Rect* bounds); + void initRender(const Rect* clip, Rect* bounds, Functor* functor); void finishRender(); void issueDrawCommand(); @@ -167,6 +165,7 @@ private: uint32_t mMaxNumberOfQuads; uint32_t mIndexBufferID; + Functor* mFunctor; const Rect* mClip; Rect* mBounds; bool mDrawn; |