summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2015-03-06 09:40:35 -0800
committerChris Craik <ccraik@google.com>2015-03-06 10:05:15 -0800
commit1c1c3fe9ebde8f911da65d49bdb91af583453dc6 (patch)
tree0274326822924171fb9ba26f4515e61bfc733c58 /libs
parentbe331a3809b9cf921c6ad65e1d671b24e97dded9 (diff)
downloadframeworks_base-1c1c3fe9ebde8f911da65d49bdb91af583453dc6.zip
frameworks_base-1c1c3fe9ebde8f911da65d49bdb91af583453dc6.tar.gz
frameworks_base-1c1c3fe9ebde8f911da65d49bdb91af583453dc6.tar.bz2
Avoid invalid shader creation for certain blend modes
bug:19627342 Change-Id: I41e3c1ce8e6fa52f046ec492d19de7cab92b9ec5
Diffstat (limited to 'libs')
-rw-r--r--libs/hwui/ProgramCache.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/libs/hwui/ProgramCache.cpp b/libs/hwui/ProgramCache.cpp
index 8c6a91cc..7ad4a57 100644
--- a/libs/hwui/ProgramCache.cpp
+++ b/libs/hwui/ProgramCache.cpp
@@ -777,6 +777,9 @@ String8 ProgramCache::generateFragmentShader(const ProgramDescription& descripti
}
void ProgramCache::generateBlend(String8& shader, const char* name, SkXfermode::Mode mode) {
+ // TODO: update gBlendOps so this workaround isn't necessary
+ if (mode > SkXfermode::kPlus_Mode) mode = SkXfermode::kClear_Mode;
+
shader.append("\nvec4 ");
shader.append(name);
shader.append("(vec4 src, vec4 dst) {\n");
@@ -830,7 +833,7 @@ void ProgramCache::printLongString(const String8& shader) const {
while ((index = shader.find("\n", index)) > -1) {
String8 line(str, index - lastIndex);
if (line.length() == 0) line.append("\n");
- PROGRAM_LOGD("%s", line.string());
+ ALOGD("%s", line.string());
index++;
str += (index - lastIndex);
lastIndex = index;