OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 | 8 |
9 #include "GrGLGpu.h" | 9 #include "GrGLGpu.h" |
10 #include "GrGLGLSL.h" | 10 #include "GrGLGLSL.h" |
(...skipping 2140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2151 // tweaked the equation to "add" or "subtract", and the coeffs to (1, 0). | 2151 // tweaked the equation to "add" or "subtract", and the coeffs to (1, 0). |
2152 | 2152 |
2153 GrBlendEquation equation = blendInfo.fEquation; | 2153 GrBlendEquation equation = blendInfo.fEquation; |
2154 GrBlendCoeff srcCoeff = blendInfo.fSrcBlend; | 2154 GrBlendCoeff srcCoeff = blendInfo.fSrcBlend; |
2155 GrBlendCoeff dstCoeff = blendInfo.fDstBlend; | 2155 GrBlendCoeff dstCoeff = blendInfo.fDstBlend; |
2156 bool blendOff = (kAdd_GrBlendEquation == equation || kSubtract_GrBlendEquati
on == equation) && | 2156 bool blendOff = (kAdd_GrBlendEquation == equation || kSubtract_GrBlendEquati
on == equation) && |
2157 kOne_GrBlendCoeff == srcCoeff && kZero_GrBlendCoeff == dstCo
eff; | 2157 kOne_GrBlendCoeff == srcCoeff && kZero_GrBlendCoeff == dstCo
eff; |
2158 if (blendOff) { | 2158 if (blendOff) { |
2159 if (kNo_TriState != fHWBlendState.fEnabled) { | 2159 if (kNo_TriState != fHWBlendState.fEnabled) { |
2160 GL_CALL(Disable(GR_GL_BLEND)); | 2160 GL_CALL(Disable(GR_GL_BLEND)); |
| 2161 |
| 2162 // Workaround for the ARM KHR_blend_equation_advanced blacklist issu
e |
| 2163 // https://code.google.com/p/skia/issues/detail?id=3943 |
| 2164 if (kARM_GrGLVendor == this->ctxInfo().vendor() && |
| 2165 GrBlendEquationIsAdvanced(fHWBlendState.fEquation)) { |
| 2166 SkASSERT(this->caps()->advancedBlendEquationSupport()); |
| 2167 // Set to any basic blending equation. |
| 2168 GrBlendEquation blend_equation = kAdd_GrBlendEquation; |
| 2169 GL_CALL(BlendEquation(gXfermodeEquation2Blend[blend_equation])); |
| 2170 fHWBlendState.fEquation = blend_equation; |
| 2171 } |
| 2172 |
2161 fHWBlendState.fEnabled = kNo_TriState; | 2173 fHWBlendState.fEnabled = kNo_TriState; |
2162 } | 2174 } |
2163 return; | 2175 return; |
2164 } | 2176 } |
2165 | 2177 |
2166 if (kYes_TriState != fHWBlendState.fEnabled) { | 2178 if (kYes_TriState != fHWBlendState.fEnabled) { |
2167 GL_CALL(Enable(GR_GL_BLEND)); | 2179 GL_CALL(Enable(GR_GL_BLEND)); |
2168 fHWBlendState.fEnabled = kYes_TriState; | 2180 fHWBlendState.fEnabled = kYes_TriState; |
2169 } | 2181 } |
2170 | 2182 |
(...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3106 this->setVertexArrayID(gpu, 0); | 3118 this->setVertexArrayID(gpu, 0); |
3107 } | 3119 } |
3108 int attrCount = gpu->glCaps().maxVertexAttributes(); | 3120 int attrCount = gpu->glCaps().maxVertexAttributes(); |
3109 if (fDefaultVertexArrayAttribState.count() != attrCount) { | 3121 if (fDefaultVertexArrayAttribState.count() != attrCount) { |
3110 fDefaultVertexArrayAttribState.resize(attrCount); | 3122 fDefaultVertexArrayAttribState.resize(attrCount); |
3111 } | 3123 } |
3112 attribState = &fDefaultVertexArrayAttribState; | 3124 attribState = &fDefaultVertexArrayAttribState; |
3113 } | 3125 } |
3114 return attribState; | 3126 return attribState; |
3115 } | 3127 } |
OLD | NEW |