Chromium Code Reviews| Index: src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp |
| diff --git a/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp b/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp |
| index 51a0340ea98b145d145addc252e5131e8870ad4c..0785e409bd4142de6c56d91935305586cf81e0b2 100644 |
| --- a/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp |
| +++ b/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp |
| @@ -183,6 +183,51 @@ const char* GrGLFragmentShaderBuilder::dstColor() { |
| } |
| } |
| +void GrGLFragmentShaderBuilder::enableAdvancedBlendEquation(GrBlendEquation advancedEquation) { |
| + SkASSERT(fProgramBuilder->gpu()->glCaps().glslCaps()->mustEnableAdvancedBlendEquations()); |
| + SkASSERT(GrBlendEquationIsAdvanced(advancedEquation)); |
| + |
| + static const char* layoutQualifierNames[] = { |
| + "blend_support_screen", |
| + "blend_support_overlay", |
| + "blend_support_darken", |
| + "blend_support_lighten", |
| + "blend_support_colordodge", |
| + "blend_support_colorburn", |
| + "blend_support_hardlight", |
| + "blend_support_softlight", |
| + "blend_support_difference", |
| + "blend_support_exclusion", |
| + "blend_support_multiply", |
| + "blend_support_hsl_hue", |
| + "blend_support_hsl_saturation", |
| + "blend_support_hsl_color", |
| + "blend_support_hsl_luminosity" |
| + }; |
| + this->addFeature(1 << kBlendEquationAdvanced_GLSLPrivateFeature, |
| + "GL_KHR_blend_equation_advanced"); |
| + this->addLayoutQualifier(layoutQualifierNames[advancedEquation - kFirstAdvancedGrBlendEquation], |
|
egdaniel
2015/05/04 19:51:21
so this doesn't ever set to blend_support_all. I w
Chris Dalton
2015/05/04 20:33:12
Yeah I don't have much insight either, outside the
egdaniel
2015/05/04 21:04:51
Okay let's keep it as is and we'll just have a TOD
Chris Dalton
2015/05/05 18:57:58
I actually went ahead and handled blend_support_al
|
| + kOut_InterfaceQualifier); |
| + |
| + GR_STATIC_ASSERT(0 == kScreen_GrBlendEquation - kFirstAdvancedGrBlendEquation); |
| + GR_STATIC_ASSERT(1 == kOverlay_GrBlendEquation - kFirstAdvancedGrBlendEquation); |
| + GR_STATIC_ASSERT(2 == kDarken_GrBlendEquation - kFirstAdvancedGrBlendEquation); |
| + GR_STATIC_ASSERT(3 == kLighten_GrBlendEquation - kFirstAdvancedGrBlendEquation); |
| + GR_STATIC_ASSERT(4 == kColorDodge_GrBlendEquation - kFirstAdvancedGrBlendEquation); |
| + GR_STATIC_ASSERT(5 == kColorBurn_GrBlendEquation - kFirstAdvancedGrBlendEquation); |
| + GR_STATIC_ASSERT(6 == kHardLight_GrBlendEquation - kFirstAdvancedGrBlendEquation); |
| + GR_STATIC_ASSERT(7 == kSoftLight_GrBlendEquation - kFirstAdvancedGrBlendEquation); |
| + GR_STATIC_ASSERT(8 == kDifference_GrBlendEquation - kFirstAdvancedGrBlendEquation); |
| + GR_STATIC_ASSERT(9 == kExclusion_GrBlendEquation - kFirstAdvancedGrBlendEquation); |
| + GR_STATIC_ASSERT(10 == kMultiply_GrBlendEquation - kFirstAdvancedGrBlendEquation); |
| + GR_STATIC_ASSERT(11 == kHSLHue_GrBlendEquation - kFirstAdvancedGrBlendEquation); |
| + GR_STATIC_ASSERT(12 == kHSLSaturation_GrBlendEquation - kFirstAdvancedGrBlendEquation); |
| + GR_STATIC_ASSERT(13 == kHSLColor_GrBlendEquation - kFirstAdvancedGrBlendEquation); |
| + GR_STATIC_ASSERT(14 == kHSLLuminosity_GrBlendEquation - kFirstAdvancedGrBlendEquation); |
| + GR_STATIC_ASSERT(SK_ARRAY_COUNT(layoutQualifierNames) == |
| + kTotalGrBlendEquationCount - kFirstAdvancedGrBlendEquation); |
| +} |
| + |
| void GrGLFragmentShaderBuilder::enableCustomOutput() { |
| if (!fHasCustomColorOutput) { |
| fHasCustomColorOutput = true; |