aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-02-07 22:39:01 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-02-07 22:39:01 +0000
commit6dee8759ab8c90dcffd76f114eec333405fd176e (patch)
tree240c8b7ef8de06dba838a34abd246a6bb54b14da /src/gpu
parentf04c21dd64895cda33edb39199cee59b2f00083c (diff)
Add workaround for Xoom crashing after discard removed from shader.
R=robertphillips@google.com TBR=robertphillips@google.com BUG=skia:2149 Author: bsalomon@google.com Review URL: https://codereview.chromium.org/133703016 git-svn-id: http://skia.googlecode.com/svn/trunk@13373 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/effects/GrConvexPolyEffect.cpp4
-rw-r--r--src/gpu/gl/GrGLUtil.cpp2
-rw-r--r--src/gpu/gl/GrGLUtil.h1
3 files changed, 7 insertions, 0 deletions
diff --git a/src/gpu/effects/GrConvexPolyEffect.cpp b/src/gpu/effects/GrConvexPolyEffect.cpp
index 98af6948ea..2f641982d7 100644
--- a/src/gpu/effects/GrConvexPolyEffect.cpp
+++ b/src/gpu/effects/GrConvexPolyEffect.cpp
@@ -75,6 +75,10 @@ void GrGLConvexPolyEffect::emitCode(GrGLShaderBuilder* builder,
}
}
+ // Woe is me. See skbug.com/2149.
+ if (kTegra2_GrGLRenderer == builder->ctxInfo().renderer()) {
+ builder->fsCodeAppend("\t\tif (-1.0 == alpha) {\n\t\t\tdiscard;\n\t\t}\n");
+ }
builder->fsCodeAppendf("\t%s = %s;\n", outputColor,
(GrGLSLExpr4(inputColor) * GrGLSLExpr1("alpha")).c_str());
}
diff --git a/src/gpu/gl/GrGLUtil.cpp b/src/gpu/gl/GrGLUtil.cpp
index 7d44ba5931..87e2f83a28 100644
--- a/src/gpu/gl/GrGLUtil.cpp
+++ b/src/gpu/gl/GrGLUtil.cpp
@@ -227,6 +227,8 @@ GrGLRenderer GrGLGetRendererFromString(const char* rendererString) {
if (NULL != rendererString) {
if (0 == strcmp(rendererString, "NVIDIA Tegra 3")) {
return kTegra3_GrGLRenderer;
+ } else if (0 == strcmp(rendererString, "NVIDIA Tegra")) {
+ return kTegra2_GrGLRenderer;
}
}
return kOther_GrGLRenderer;
diff --git a/src/gpu/gl/GrGLUtil.h b/src/gpu/gl/GrGLUtil.h
index eb49cefc42..b99487a1af 100644
--- a/src/gpu/gl/GrGLUtil.h
+++ b/src/gpu/gl/GrGLUtil.h
@@ -31,6 +31,7 @@ enum GrGLVendor {
};
enum GrGLRenderer {
+ kTegra2_GrGLRenderer,
kTegra3_GrGLRenderer,
kOther_GrGLRenderer