Index: include/gpu/GrXferProcessor.h |
diff --git a/include/gpu/GrXferProcessor.h b/include/gpu/GrXferProcessor.h |
index 539406e622724f995e11548710adee2b90d09bd2..d9ac338ead6bb1c8565276de47fa1f1b273bd9dc 100644 |
--- a/include/gpu/GrXferProcessor.h |
+++ b/include/gpu/GrXferProcessor.h |
@@ -20,6 +20,43 @@ class GrGLXferProcessor; |
class GrProcOptInfo; |
/** |
+ * Equations for alpha-blending. |
+ */ |
+enum GrBlendEquation { |
+ kInvalid_GrBlendEquation = -1, |
+ |
+ // Basic blend equations. |
+ kAdd_GrBlendEquation, //<! Cs*S + Cd*D |
+ kSubtract_GrBlendEquation, //<! Cs*S - Cd*D |
+ kReverseSubtract_GrBlendEquation, //<! Cd*D - Cs*S |
+ |
+ kLastBasicGrBlendEquation = kReverseSubtract_GrBlendEquation, |
+ |
+ // Advanced blend equations. These are described in the SVG and PDF specs. |
+ kScreen_GrBlendEquation, |
+ kOverlay_GrBlendEquation, |
+ kDarken_GrBlendEquation, |
+ kLighten_GrBlendEquation, |
+ kColorDodge_GrBlendEquation, |
+ kColorBurn_GrBlendEquation, |
+ kHardLight_GrBlendEquation, |
+ kSoftLight_GrBlendEquation, |
+ kDifference_GrBlendEquation, |
+ kExclusion_GrBlendEquation, |
+ kMultiply_GrBlendEquation, |
+ kHSLHue_GrBlendEquation, |
+ kHSLSaturation_GrBlendEquation, |
+ kHSLColor_GrBlendEquation, |
+ kHSLLuminosity_GrBlendEquation, |
+ |
+ kTotalGrBlendEquationCount |
+}; |
+ |
+inline bool GrBlendEquationIsAdvanced(GrBlendEquation equation) { |
+ return equation > kLastBasicGrBlendEquation; |
+} |
+ |
+/** |
* Coeffecients for alpha-blending. |
*/ |
enum GrBlendCoeff { |
@@ -53,6 +90,7 @@ enum GrBlendCoeff { |
*/ |
enum GrXferBarrierType { |
kTexture_GrXferBarrierType, //<! Required when a shader reads and renders to the same texture. |
+ kBlend_GrXferBarrierType, //<! Required by certain blend extensions. |
}; |
/** |
@@ -142,12 +180,14 @@ public: |
struct BlendInfo { |
void reset() { |
+ fEquation = kAdd_GrBlendEquation; |
fSrcBlend = kOne_GrBlendCoeff; |
fDstBlend = kZero_GrBlendCoeff; |
fBlendConstant = 0; |
fWriteColor = true; |
} |
+ GrBlendEquation fEquation; |
GrBlendCoeff fSrcBlend; |
GrBlendCoeff fDstBlend; |
GrColor fBlendConstant; |