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

Unified Diff: src/gpu/effects/GrCustomXfermode.cpp

Issue 1164973002: Add mixed samples support to XPs (Closed) Base URL: https://skia.googlesource.com/skia.git@upload2_reenablebea
Patch Set: Created 5 years, 6 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 | « src/gpu/effects/GrCoverageSetOpXP.cpp ('k') | src/gpu/effects/GrCustomXfermodePriv.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrCustomXfermode.cpp
diff --git a/src/gpu/effects/GrCustomXfermode.cpp b/src/gpu/effects/GrCustomXfermode.cpp
index 3439a8258bbcb025052e9ffae91e123de46b6352..b43d2d4ce64516d27a5e0d970b00658935e10dbb 100644
--- a/src/gpu/effects/GrCustomXfermode.cpp
+++ b/src/gpu/effects/GrCustomXfermode.cpp
@@ -524,8 +524,8 @@ public:
this->initClassID<CustomXP>();
}
- CustomXP(SkXfermode::Mode mode, const DstTexture* dstTexture)
- : INHERITED(dstTexture, true),
+ CustomXP(const DstTexture* dstTexture, bool hasMixedSamples, SkXfermode::Mode mode)
+ : INHERITED(dstTexture, true, hasMixedSamples),
fMode(mode),
fHWBlendEquation(static_cast<GrBlendEquation>(-1)) {
this->initClassID<CustomXP>();
@@ -606,8 +606,8 @@ private:
GrGLXPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
fsBuilder->enableAdvancedBlendEquationIfNeeded(xp.hwBlendEquation());
- // Apply coverage by multiplying it into the src color before blending.
- // (See onGetOptimizations())
+ // Apply coverage by multiplying it into the src color before blending. Mixed samples will
+ // "just work" automatically. (See onGetOptimizations())
if (xp.readsCoverage()) {
fsBuilder->codeAppendf("%s = %s * %s;",
args.fOutputPrimary, args.fInputCoverage, args.fInputColor);
@@ -786,17 +786,19 @@ GrXferProcessor*
GrCustomXPFactory::onCreateXferProcessor(const GrCaps& caps,
const GrProcOptInfo& colorPOI,
const GrProcOptInfo& coveragePOI,
+ bool hasMixedSamples,
const DstTexture* dstTexture) const {
if (can_use_hw_blend_equation(coveragePOI, caps)) {
SkASSERT(!dstTexture || !dstTexture->texture());
return SkNEW_ARGS(CustomXP, (fMode, fHWBlendEquation));
}
- return SkNEW_ARGS(CustomXP, (fMode, dstTexture));
+ return SkNEW_ARGS(CustomXP, (dstTexture, hasMixedSamples, fMode));
}
bool GrCustomXPFactory::willReadDstColor(const GrCaps& caps,
const GrProcOptInfo& colorPOI,
- const GrProcOptInfo& coveragePOI) const {
+ const GrProcOptInfo& coveragePOI,
+ bool hasMixedSamples) const {
return !can_use_hw_blend_equation(coveragePOI, caps);
}
« no previous file with comments | « src/gpu/effects/GrCoverageSetOpXP.cpp ('k') | src/gpu/effects/GrCustomXfermodePriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698