Implement support for KHR_blend_equation_advanced
Uses KHR(or NV)_blend_equation_advanced to implement custom Xfer modes
in hardware.
BUG=skia:
Review URL: https://codereview.chromium.org/1037123003
diff --git a/src/gpu/gl/builders/GrGLFragmentShaderBuilder.h b/src/gpu/gl/builders/GrGLFragmentShaderBuilder.h
index 7afc76c..1ab7af6 100644
--- a/src/gpu/gl/builders/GrGLFragmentShaderBuilder.h
+++ b/src/gpu/gl/builders/GrGLFragmentShaderBuilder.h
@@ -66,6 +66,11 @@
no effect advertised that it will read the destination. */
virtual const char* dstColor() = 0;
+ /** Adds any necessary layout qualifiers in order to legalize the supplied blend equation with
+ this shader. It is only legal to call this method with an advanced blend equation, and only
+ if these equations are supported. */
+ virtual void enableAdvancedBlendEquationIfNeeded(GrBlendEquation) = 0;
+
private:
typedef GrGLFragmentBuilder INHERITED;
};
@@ -95,6 +100,8 @@
const char* fragmentPosition() override;
const char* dstColor() override;
+ void enableAdvancedBlendEquationIfNeeded(GrBlendEquation) override;
+
private:
// Private public interface, used by GrGLProgramBuilder to build a fragment shader
void enableCustomOutput();
@@ -123,7 +130,8 @@
*/
enum GLSLPrivateFeature {
kFragCoordConventions_GLSLPrivateFeature = kLastGLSLFeature + 1,
- kLastGLSLPrivateFeature = kFragCoordConventions_GLSLPrivateFeature
+ kBlendEquationAdvanced_GLSLPrivateFeature,
+ kLastGLSLPrivateFeature = kBlendEquationAdvanced_GLSLPrivateFeature
};
// Interpretation of DstReadKey when generating code