diff options
author | Romain Guy <romainguy@google.com> | 2013-06-04 18:00:09 -0700 |
---|---|---|
committer | Romain Guy <romainguy@google.com> | 2013-06-04 18:58:36 -0700 |
commit | 8aa195d7081b889f3a7b1f426cbd8556377aae5e (patch) | |
tree | 6cd0ab4181c25d3113c4e39b49e8f8a0c7d12b8b /libs/hwui/TextDropShadowCache.cpp | |
parent | 84f3c5689cffbfc1e45a0101d5bb636323769f54 (diff) | |
download | frameworks_base-8aa195d7081b889f3a7b1f426cbd8556377aae5e.zip frameworks_base-8aa195d7081b889f3a7b1f426cbd8556377aae5e.tar.gz frameworks_base-8aa195d7081b889f3a7b1f426cbd8556377aae5e.tar.bz2 |
Introduce Caches::bindTexture() to reduce glBindTexture calls
Change-Id: Ic345422567c020c0a9035ff51dcf2ae2a1fc59f4
Diffstat (limited to 'libs/hwui/TextDropShadowCache.cpp')
-rw-r--r-- | libs/hwui/TextDropShadowCache.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libs/hwui/TextDropShadowCache.cpp b/libs/hwui/TextDropShadowCache.cpp index 6976eaa..3b6cb91 100644 --- a/libs/hwui/TextDropShadowCache.cpp +++ b/libs/hwui/TextDropShadowCache.cpp @@ -18,6 +18,7 @@ #include <utils/JenkinsHash.h> +#include "Caches.h" #include "Debug.h" #include "TextDropShadowCache.h" #include "Properties.h" @@ -182,7 +183,9 @@ ShadowTexture* TextDropShadowCache::get(SkPaint* paint, const char* text, uint32 return NULL; } - texture = new ShadowTexture; + Caches& caches = Caches::getInstance(); + + texture = new ShadowTexture(caches); texture->left = shadow.penX; texture->top = shadow.penY; texture->width = shadow.width; @@ -202,7 +205,7 @@ ShadowTexture* TextDropShadowCache::get(SkPaint* paint, const char* text, uint32 glGenTextures(1, &texture->id); - glBindTexture(GL_TEXTURE_2D, texture->id); + caches.bindTexture(texture->id); // Textures are Alpha8 glPixelStorei(GL_UNPACK_ALIGNMENT, 1); |