summaryrefslogtreecommitdiff
path: root/libs/hwui/ProgramCache.cpp
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2013-02-25 14:15:37 -0800
committerRomain Guy <romainguy@google.com>2013-02-25 15:01:58 -0800
commit3ff0bfdd144bba3b023eda8c49b25fb0d0de8653 (patch)
treecfc94ccf18fb1bfaaefb1241c700900a32276acf /libs/hwui/ProgramCache.cpp
parent01d159d88a51c44d7e282e07b834535e5b0e8bd1 (diff)
Add new property to debug non-rectangular clip operations
This change adds a new property called "debug.hwui.show_stencil_clip" that accepts the following values: - "highlight", colorizes in green any drawing command that's tested against a non-rectangular clip region - "region", shows the non-rectangular clip region in blue every time it is used - "hide", default value, nothing is shown Change-Id: I83c8602310edc4aaeb8b905371cdd185b17d32b5
Diffstat (limited to 'libs/hwui/ProgramCache.cpp')
-rw-r--r--libs/hwui/ProgramCache.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/libs/hwui/ProgramCache.cpp b/libs/hwui/ProgramCache.cpp
index 74d598d5311e..0f014cbfa96a 100644
--- a/libs/hwui/ProgramCache.cpp
+++ b/libs/hwui/ProgramCache.cpp
@@ -351,6 +351,8 @@ const char* gFS_Main_ApplyColorOp[4] = {
// PorterDuff
" fragColor = blendColors(colorBlend, fragColor);\n"
};
+const char* gFS_Main_DebugHighlight =
+ " gl_FragColor.rgb = vec3(0.0, gl_FragColor.a, 0.0);\n";
const char* gFS_Footer =
"}\n\n";
@@ -604,7 +606,8 @@ String8 ProgramCache::generateFragmentShader(const ProgramDescription& descripti
// Optimization for common cases
if (!description.isAA && !blendFramebuffer && !description.hasColors &&
- description.colorOp == ProgramDescription::kColorNone && !description.isPoint) {
+ description.colorOp == ProgramDescription::kColorNone &&
+ !description.isPoint && !description.hasDebugHighlight) {
bool fast = false;
const bool noShader = !description.hasGradient && !description.hasBitmap;
@@ -752,6 +755,9 @@ String8 ProgramCache::generateFragmentShader(const ProgramDescription& descripti
if (description.hasColors) {
shader.append(gFS_Main_FragColor_HasColors);
}
+ if (description.hasDebugHighlight) {
+ shader.append(gFS_Main_DebugHighlight);
+ }
}
// End the shader
shader.append(gFS_Footer);