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

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: fix 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
« no previous file with comments | « include/effects/SkModeColorFilter.h ('k') | include/gpu/GrColor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ||
« no previous file with comments | « include/effects/SkModeColorFilter.h ('k') | include/gpu/GrColor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698