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

Unified Diff: include/gpu/SkGr.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/gpu/GrInvariantOutput.h ('k') | include/gpu/effects/GrCustomXfermode.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/SkGr.h
diff --git a/include/gpu/SkGr.h b/include/gpu/SkGr.h
index 68b93a1f8a7e15fcc775c95ead7016325d0ae59c..99a361bca1facb87705f1133d56fd441687a097e 100644
--- a/include/gpu/SkGr.h
+++ b/include/gpu/SkGr.h
@@ -38,8 +38,9 @@ GR_STATIC_ASSERT((int)kSA_GrBlendCoeff == (int)SkXfermode::kSA_Coeff);
GR_STATIC_ASSERT((int)kISA_GrBlendCoeff == (int)SkXfermode::kISA_Coeff);
GR_STATIC_ASSERT((int)kDA_GrBlendCoeff == (int)SkXfermode::kDA_Coeff);
GR_STATIC_ASSERT((int)kIDA_GrBlendCoeff == (int)SkXfermode::kIDA_Coeff);
+GR_STATIC_ASSERT(SkXfermode::kCoeffCount == 10);
-#define sk_blend_to_grblend(X) ((GrBlendCoeff)(X))
+#define SkXfermodeCoeffToGrBlendCoeff(X) ((GrBlendCoeff)(X))
///////////////////////////////////////////////////////////////////////////////
@@ -67,6 +68,16 @@ static inline GrColor SkColor2GrColorJustAlpha(SkColor c) {
return GrColorPackRGBA(a, a, a, a);
}
+static inline SkPMColor GrColorToSkPMColor(GrColor c) {
+ GrColorIsPMAssert(c);
+ return SkPackARGB32(GrColorUnpackA(c), GrColorUnpackR(c), GrColorUnpackG(c), GrColorUnpackB(c));
+}
+
+static inline GrColor SkPMColorToGrColor(SkPMColor c) {
+ return GrColorPackRGBA(SkGetPackedR32(c), SkGetPackedG32(c), SkGetPackedB32(c),
+ SkGetPackedA32(c));
+}
+
////////////////////////////////////////////////////////////////////////////////
/**
« no previous file with comments | « include/gpu/GrInvariantOutput.h ('k') | include/gpu/effects/GrCustomXfermode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698