aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar joel.liang <joel.liang@arm.com>2015-07-09 19:46:18 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-07-09 19:46:18 -0700
commit9764c40cd31c11c82686c8b8dbbeaea9fa4de05d (patch)
treee7ee2c6ccf66541b63aeec94586118d246735284 /src/gpu
parentea561bf055bb803f4c10ca323ea60a9d94da7956 (diff)
Workaround for blacklist KHR_blend_equation_advanced on ARM GPU
ARM driver will check the fragment shader compatiblity for KHR_blend_equation_advanced even if blending is disabled. Workaround: Set blending equation to any basic equation when we disable blending. https://code.google.com/p/skia/issues/detail?id=3943 BUG=skia:3943 Review URL: https://codereview.chromium.org/1216963004
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/gl/GrGLCaps.cpp7
-rw-r--r--src/gpu/gl/GrGLGpu.cpp12
2 files changed, 17 insertions, 2 deletions
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index 539212c3a5..22ad05746a 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -888,8 +888,7 @@ void GrGLCaps::initBlendEqationSupport(const GrGLContextInfo& ctxInfo) {
// for now until its own blacklists can be updated.
if (kAdreno4xx_GrGLRenderer == ctxInfo.renderer() ||
kIntel_GrGLDriver == ctxInfo.driver() ||
- kChromium_GrGLDriver == ctxInfo.driver() ||
- kARM_GrGLVendor == ctxInfo.vendor()) {
+ kChromium_GrGLDriver == ctxInfo.driver()) {
return;
}
@@ -922,6 +921,10 @@ void GrGLCaps::initBlendEqationSupport(const GrGLContextInfo& ctxInfo) {
fAdvBlendEqBlacklist |= (1 << kColorDodge_GrBlendEquation) |
(1 << kColorBurn_GrBlendEquation);
}
+ if (kARM_GrGLVendor == ctxInfo.vendor()) {
+ // Blacklist color-burn on ARM until the fix is released.
+ fAdvBlendEqBlacklist |= (1 << kColorBurn_GrBlendEquation);
+ }
}
namespace {
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index 20669b8e78..626a72f936 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -2158,6 +2158,18 @@ void GrGLGpu::flushBlend(const GrXferProcessor::BlendInfo& blendInfo) {
if (blendOff) {
if (kNo_TriState != fHWBlendState.fEnabled) {
GL_CALL(Disable(GR_GL_BLEND));
+
+ // Workaround for the ARM KHR_blend_equation_advanced blacklist issue
+ // https://code.google.com/p/skia/issues/detail?id=3943
+ if (kARM_GrGLVendor == this->ctxInfo().vendor() &&
+ GrBlendEquationIsAdvanced(fHWBlendState.fEquation)) {
+ SkASSERT(this->caps()->advancedBlendEquationSupport());
+ // Set to any basic blending equation.
+ GrBlendEquation blend_equation = kAdd_GrBlendEquation;
+ GL_CALL(BlendEquation(gXfermodeEquation2Blend[blend_equation]));
+ fHWBlendState.fEquation = blend_equation;
+ }
+
fHWBlendState.fEnabled = kNo_TriState;
}
return;