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, |