diff options
author | Chris Craik <ccraik@google.com> | 2013-03-01 11:08:11 -0800 |
---|---|---|
committer | Chris Craik <ccraik@google.com> | 2013-03-01 11:11:31 -0800 |
commit | 096b8d96d539429de5e67b2821ef3f9ee0300842 (patch) | |
tree | c3e603e03eea99c186dda4f9563c8ec6afececb7 /libs | |
parent | 29466f85c06b7b58b2d058dcf293298fecdeb704 (diff) | |
download | frameworks_base-096b8d96d539429de5e67b2821ef3f9ee0300842.zip frameworks_base-096b8d96d539429de5e67b2821ef3f9ee0300842.tar.gz frameworks_base-096b8d96d539429de5e67b2821ef3f9ee0300842.tar.bz2 |
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
Diffstat (limited to 'libs')
-rw-r--r-- | libs/hwui/Program.h | 1 | ||||
-rw-r--r-- | libs/hwui/ProgramCache.cpp | 6 | ||||
-rw-r--r-- | libs/hwui/ProgramCache.h | 11 |
3 files changed, 7 insertions, 11 deletions
diff --git a/libs/hwui/Program.h b/libs/hwui/Program.h index 13ee336..e8b6d47 100644 --- a/libs/hwui/Program.h +++ b/libs/hwui/Program.h @@ -24,6 +24,7 @@ #include <SkXfermode.h> +#include "Debug.h" #include "Matrix.h" #include "Properties.h" 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 @@ void ProgramCache::clear() { 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) { diff --git a/libs/hwui/ProgramCache.h b/libs/hwui/ProgramCache.h index 6cfe0c7..1ca148d 100644 --- a/libs/hwui/ProgramCache.h +++ b/libs/hwui/ProgramCache.h @@ -31,17 +31,6 @@ namespace android { namespace uirenderer { /////////////////////////////////////////////////////////////////////////////// -// Defines -/////////////////////////////////////////////////////////////////////////////// - -// Debug -#if DEBUG_PROGRAMS - #define PROGRAM_LOGD(...) ALOGD(__VA_ARGS__) -#else - #define PROGRAM_LOGD(...) -#endif - -/////////////////////////////////////////////////////////////////////////////// // Cache /////////////////////////////////////////////////////////////////////////////// |