aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2017-05-19 16:33:51 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-05-19 20:57:47 +0000
commit49354a30ea8a24d1f374e5eda79ed603010c43bd (patch)
tree54b603af46bc258c67264cfaa80e808932d6b55f
parentc7f98bc1fd399045d4357e18666560c559639535 (diff)
Update Porter Duff analysis to match LCD logic.
Bug: skia: Change-Id: Ib222c37f7ebb307752806829742a3b6278dbae3d Reviewed-on: https://skia-review.googlesource.com/17410 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
-rw-r--r--src/gpu/effects/GrPorterDuffXferProcessor.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gpu/effects/GrPorterDuffXferProcessor.cpp b/src/gpu/effects/GrPorterDuffXferProcessor.cpp
index d3ef717c35..269262b343 100644
--- a/src/gpu/effects/GrPorterDuffXferProcessor.cpp
+++ b/src/gpu/effects/GrPorterDuffXferProcessor.cpp
@@ -807,10 +807,11 @@ static inline GrXPFactory::AnalysisProperties analysis_properties(
if (GrProcessorAnalysisCoverage::kLCD == coverage) {
// Check for special case of srcover with a known color which can be done using the
// blend constant.
- if (SkBlendMode::kSrcOver == mode && color.isConstant() && color.isOpaque()) {
+ if (SkBlendMode::kSrcOver == mode && color.isConstant() && color.isOpaque() &&
+ !caps.shaderCaps()->dstReadInShaderSupport()) {
props |= AnalysisProperties::kIgnoresInputColor;
} else {
- if (get_lcd_blend_formula(mode).hasSecondaryOutput()) {
+ if (get_lcd_blend_formula(mode).hasSecondaryOutput() || !color.isOpaque()) {
props |= AnalysisProperties::kReadsDstInShader;
}
}