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

Unified Diff: include/gpu/GrBlend.h

Issue 1334293003: Create fragment processor for performing input color blend with child processor (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: working Created 5 years, 3 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: include/gpu/GrBlend.h
diff --git a/include/gpu/GrBlend.h b/include/gpu/GrBlend.h
index 51c19f97219d2174f1e77c897fc8e945fbf67cb3..7ad668c01a2f0da17f71c7f5c82ce93e4c1b6707 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,18 @@ 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. This only works for
+ */
+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 +107,6 @@ inline bool GrBlendCoeffRefsSrc(GrBlendCoeff coeff) {
}
}
-
template<GrBlendCoeff Coeff>
struct GrTBlendCoeffRefsDst : skstd::bool_constant<kDC_GrBlendCoeff == Coeff ||
kIDC_GrBlendCoeff == Coeff ||

Powered by Google App Engine
This is Rietveld 408576698