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

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

Issue 1149883004: Fix LCD coverage regression in GrPorterDuffXPFactory (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: clang warning Created 5 years, 7 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 | « no previous file | tests/GrPorterDuffTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrPorterDuffXferProcessor.cpp
diff --git a/src/gpu/effects/GrPorterDuffXferProcessor.cpp b/src/gpu/effects/GrPorterDuffXferProcessor.cpp
index de0143aceaf72346f818ddce9b71278a5e812aef..bc61f499e42ba3263af5f57d7f4ed817f3ef7d7e 100644
--- a/src/gpu/effects/GrPorterDuffXferProcessor.cpp
+++ b/src/gpu/effects/GrPorterDuffXferProcessor.cpp
@@ -744,11 +744,16 @@ bool GrPorterDuffXPFactory::supportsRGBCoverage(GrColor /*knownColor*/,
void GrPorterDuffXPFactory::getInvariantOutput(const GrProcOptInfo& colorPOI,
const GrProcOptInfo& coveragePOI,
GrXPFactory::InvariantOutput* output) const {
- const BlendFormula& blendFormula = get_blend_formula(fXfermode, colorPOI, coveragePOI);
+ output->fWillBlendWithDst = true;
+ output->fBlendedColorFlags = kNone_GrColorComponentFlags;
+ // The LCD coverage XP doesn't use the blend table, and has no invariant output.
+ if (coveragePOI.isFourChannelOutput()) {
+ return;
+ }
+
+ const BlendFormula& blendFormula = get_blend_formula(fXfermode, colorPOI, coveragePOI);
if (blendFormula.usesDstColor()) {
- output->fWillBlendWithDst = true;
- output->fBlendedColorFlags = kNone_GrColorComponentFlags;
return;
}
@@ -768,16 +773,18 @@ void GrPorterDuffXPFactory::getInvariantOutput(const GrProcOptInfo& colorPOI,
output->fBlendedColorFlags = colorPOI.validFlags();
return;
- // TODO: update if we ever use const color.
- default:
- output->fBlendedColorFlags = kNone_GrColorComponentFlags;
- return;
+ default: return;
}
}
bool GrPorterDuffXPFactory::willReadDstColor(const GrCaps& caps,
const GrProcOptInfo& colorPOI,
const GrProcOptInfo& coveragePOI) const {
+ // The LCD coverage XP doesn't use the blend table, and never requires a dst read.
+ if (coveragePOI.isFourChannelOutput()) {
+ return false;
+ }
+
// Some formulas use dual source blending, so we fall back if it is required but not supported.
return !caps.shaderCaps()->dualSourceBlendingSupport() &&
get_blend_formula(fXfermode, colorPOI, coveragePOI).hasSecondaryOutput();
« no previous file with comments | « no previous file | tests/GrPorterDuffTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698