Index: include/gpu/GrBlend.h |
diff --git a/include/gpu/GrBlend.h b/include/gpu/GrBlend.h |
index 51c19f97219d2174f1e77c897fc8e945fbf67cb3..5100bb05396b990ca7ca4942465876cc29a2a52b 100644 |
--- a/include/gpu/GrBlend.h |
+++ b/include/gpu/GrBlend.h |
@@ -6,12 +6,12 @@ |
* found in the LICENSE file. |
*/ |
-#include "GrTypes.h" |
-#include "../private/SkTLogic.h" |
- |
#ifndef GrBlend_DEFINED |
#define GrBlend_DEFINED |
+#include "GrColor.h" |
+#include "../private/SkTLogic.h" |
+ |
/** |
* Equations for alpha-blending. |
*/ |
@@ -46,7 +46,7 @@ static const int kGrBlendEquationCnt = kLast_GrBlendEquation + 1; |
/** |
- * Coeffecients for alpha-blending. |
+ * Coefficients for alpha-blending. |
*/ |
enum GrBlendCoeff { |
kZero_GrBlendCoeff, //<! 0 |
@@ -73,6 +73,19 @@ enum GrBlendCoeff { |
static const int kGrBlendCoeffCnt = kLast_GrBlendCoeff + 1; |
+/** |
+ * Given a known blend equation in the form of srcCoeff * srcColor + dstCoeff * dstColor where |
+ * there may be partial knowledge of the srcColor and dstColor component values, determine what |
+ * components of the blended output color are known. Coeffs must not refer to the constant or |
+ * secondary src color. |
+ */ |
+void GrGetCoeffBlendKnownComponents(GrBlendCoeff srcCoeff, GrBlendCoeff dstCoeff, |
+ GrColor srcColor, |
+ GrColorComponentFlags srcColorFlags, |
+ GrColor dstColor, |
+ GrColorComponentFlags dstColorFlags, |
+ GrColor* outColor, |
+ GrColorComponentFlags* outFlags); |
template<GrBlendCoeff Coeff> |
struct GrTBlendCoeffRefsSrc : skstd::bool_constant<kSC_GrBlendCoeff == Coeff || |
@@ -95,7 +108,6 @@ inline bool GrBlendCoeffRefsSrc(GrBlendCoeff coeff) { |
} |
} |
- |
template<GrBlendCoeff Coeff> |
struct GrTBlendCoeffRefsDst : skstd::bool_constant<kDC_GrBlendCoeff == Coeff || |
kIDC_GrBlendCoeff == Coeff || |