Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(303)

Unified Diff: src/gpu/gl/GrGLCaps.h

Issue 1037123003: Implement support for KHR_blend_equation_advanced (Closed) Base URL: https://skia.googlesource.com/skia.git@upload_zzz2_barriers
Patch Set: Rebase, blend_support_all_equations Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/gpu/gl/GrGLCaps.h
diff --git a/src/gpu/gl/GrGLCaps.h b/src/gpu/gl/GrGLCaps.h
index 13ba3863b1228efc806a0da20e7c0f0fee30604b..5f98b7661c9cf4dae0d5d0fd0ce93e506d1a7527 100644
--- a/src/gpu/gl/GrGLCaps.h
+++ b/src/gpu/gl/GrGLCaps.h
@@ -380,6 +380,19 @@ public:
SK_DECLARE_INST_COUNT(GrGLSLCaps)
/**
+ * Indicates how GLSL must interact with advanced blend equations. The KHR extension requires
+ * special layout qualifiers in the fragment shader.
+ */
+ enum AdvancedBlendEqnInteraction {
+ kNotSupported_AdvancedBlendEqnInteraction, //<! No advanced blend equation support
+ kAutomatic_AdvancedBlendEqnInteraction, //<! No interaction required
+ kMustEnable_AdvancedBlendEqnInteraction, //<! Blanket qualifier for all equations
+ kMustEnableSeparately_AdvancedBlendEqnInteraction, //<! Separate qualifiers per equation
+
+ kLast_AdvancedBlendEqnInteraction = kMustEnableSeparately_AdvancedBlendEqnInteraction
+ };
+
+ /**
* Creates a GrGLSLCaps that advertises no support for any extensions,
* formats, etc. Call init to initialize from a GrGLContextInfo.
*/
@@ -399,7 +412,7 @@ public:
* Initializes the GrGLSLCaps to the set of features supported in the current
* OpenGL context accessible via ctxInfo.
*/
- bool init(const GrGLContextInfo& ctxInfo, const GrGLInterface* glInterface);
+ bool init(const GrGLContextInfo&, const GrGLInterface*, const GrGLCaps&);
/**
* Some helper functions for encapsulating various extensions to read FB Buffer on openglES
@@ -416,6 +429,14 @@ public:
bool dropsTileOnZeroDivide() const { return fDropsTileOnZeroDivide; }
+ AdvancedBlendEqnInteraction advancedBlendEqnInteraction() const {
+ return fAdvancedBlendEqnInteraction;
+ }
+
+ bool mustEnableAdvancedBlendEquations() const {
+ return fAdvancedBlendEqnInteraction >= kMustEnable_AdvancedBlendEqnInteraction;
+ }
+
/**
* Returns a string containing the caps info.
*/
@@ -432,6 +453,8 @@ private:
const char* fFBFetchColorName;
const char* fFBFetchExtensionString;
+ AdvancedBlendEqnInteraction fAdvancedBlendEqnInteraction;
+
typedef GrShaderCaps INHERITED;
};

Powered by Google App Engine
This is Rietveld 408576698