Add shader program selection shortcut
Add a key manipulation that makes black text/paths use the standard
simple bitmap/patch shader, since they are the same. Previously we'd
create a separate shader for each because the keys differed, even
though the shaders were functionally equivalent.
Also fixes some issues around setting DEBUG_PROGRAM
Change-Id: I0c77c684d58da03501ee9ab8239c7d4a70fd6b5c
diff --git a/libs/hwui/ProgramCache.cpp b/libs/hwui/ProgramCache.cpp
index 0f014cb..f78fb2d 100644
--- a/libs/hwui/ProgramCache.cpp
+++ b/libs/hwui/ProgramCache.cpp
@@ -433,6 +433,12 @@
Program* ProgramCache::get(const ProgramDescription& description) {
programid key = description.key();
+ if (key == (PROGRAM_KEY_TEXTURE | PROGRAM_KEY_A8_TEXTURE)) {
+ // program for A8, unmodulated, texture w/o shader (black text/path textures) is equivalent
+ // to standard texture program (bitmaps, patches). Consider them equivalent.
+ key = PROGRAM_KEY_TEXTURE;
+ }
+
ssize_t index = mCache.indexOfKey(key);
Program* program = NULL;
if (index < 0) {