aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrDrawTargetCaps.h
diff options
context:
space:
mode:
authorGravatar cdalton <cdalton@nvidia.com>2015-05-06 13:40:21 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-05-06 13:40:21 -0700
commit8917d62ef4d9bde9ec4f879dc42b309b03a0ad98 (patch)
tree155b2ec06eecc8aadee64f9152b6ea95515778ce /src/gpu/GrDrawTargetCaps.h
parente0cab96599764f7611de015f558a6b22162c3eda (diff)
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
Diffstat (limited to 'src/gpu/GrDrawTargetCaps.h')
-rw-r--r--src/gpu/GrDrawTargetCaps.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/gpu/GrDrawTargetCaps.h b/src/gpu/GrDrawTargetCaps.h
index 310703caca..0f7a712dc6 100644
--- a/src/gpu/GrDrawTargetCaps.h
+++ b/src/gpu/GrDrawTargetCaps.h
@@ -142,6 +142,30 @@ public:
bool useDrawInsteadOfClear() const { return fUseDrawInsteadOfClear; }
/**
+ * Indicates the capabilities of the fixed function blend unit.
+ */
+ enum BlendEquationSupport {
+ kBasic_BlendEquationSupport, //<! Support to select the operator that
+ // combines src and dst terms.
+ kAdvanced_BlendEquationSupport, //<! Additional fixed function support for specific
+ // SVG/PDF blend modes. Requires blend barriers.
+ kAdvancedCoherent_BlendEquationSupport, //<! Advanced blend equation support that does not
+ // require blend barriers, and permits overlap.
+
+ kLast_BlendEquationSupport = kAdvancedCoherent_BlendEquationSupport
+ };
+
+ BlendEquationSupport blendEquationSupport() const { return fBlendEquationSupport; }
+
+ bool advancedBlendEquationSupport() const {
+ return fBlendEquationSupport >= kAdvanced_BlendEquationSupport;
+ }
+
+ bool advancedCoherentBlendEquationSupport() const {
+ return kAdvancedCoherent_BlendEquationSupport == fBlendEquationSupport;
+ }
+
+ /**
* Indicates whether GPU->CPU memory mapping for GPU resources such as vertex buffers and
* textures allows partial mappings or full mappings.
*/
@@ -192,6 +216,7 @@ protected:
// Driver workaround
bool fUseDrawInsteadOfClear : 1;
+ BlendEquationSupport fBlendEquationSupport;
uint32_t fMapBufferFlags;
int fMaxRenderTargetSize;