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

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

Issue 1166513002: Re-enable advanced blend with a blacklist (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix msvc 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/GrCaps.cpp ('k') | src/gpu/gl/GrGLCaps.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 b43d2d4ce64516d27a5e0d970b00658935e10dbb..794e55efdcf9bd99e68723bfa7440fb110db1641 100644
--- a/src/gpu/effects/GrCustomXfermode.cpp
+++ b/src/gpu/effects/GrCustomXfermode.cpp
@@ -51,13 +51,18 @@ static GrBlendEquation hw_blend_equation(SkXfermode::Mode mode) {
GR_STATIC_ASSERT(kGrBlendEquationCnt == SkXfermode::kLastMode + 1 + kOffset);
}
-static bool can_use_hw_blend_equation(const GrProcOptInfo& coveragePOI, const GrCaps& caps) {
+static bool can_use_hw_blend_equation(GrBlendEquation equation,
+ const GrProcOptInfo& coveragePOI,
+ const GrCaps& caps) {
if (!caps.advancedBlendEquationSupport()) {
return false;
}
if (coveragePOI.isFourChannelOutput()) {
return false; // LCD coverage must be applied after the blend equation.
}
+ if (caps.canUseAdvancedBlendEquation(equation)) {
+ return false;
+ }
return true;
}
@@ -788,7 +793,7 @@ GrCustomXPFactory::onCreateXferProcessor(const GrCaps& caps,
const GrProcOptInfo& coveragePOI,
bool hasMixedSamples,
const DstTexture* dstTexture) const {
- if (can_use_hw_blend_equation(coveragePOI, caps)) {
+ if (can_use_hw_blend_equation(fHWBlendEquation, coveragePOI, caps)) {
SkASSERT(!dstTexture || !dstTexture->texture());
return SkNEW_ARGS(CustomXP, (fMode, fHWBlendEquation));
}
@@ -799,7 +804,7 @@ bool GrCustomXPFactory::willReadDstColor(const GrCaps& caps,
const GrProcOptInfo& colorPOI,
const GrProcOptInfo& coveragePOI,
bool hasMixedSamples) const {
- return !can_use_hw_blend_equation(coveragePOI, caps);
+ return !can_use_hw_blend_equation(fHWBlendEquation, coveragePOI, caps);
}
void GrCustomXPFactory::getInvariantBlendedColor(const GrProcOptInfo& colorPOI,
« no previous file with comments | « src/gpu/GrCaps.cpp ('k') | src/gpu/gl/GrGLCaps.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698