Chromium Code Reviews| Index: src/gpu/effects/GrPorterDuffXferProcessor.cpp |
| diff --git a/src/gpu/effects/GrPorterDuffXferProcessor.cpp b/src/gpu/effects/GrPorterDuffXferProcessor.cpp |
| index 733e552eea7bc1298d1ad07fae918111ae6564d7..f609cd2b8e19bdf266c846872b1f42923fc8a071 100644 |
| --- a/src/gpu/effects/GrPorterDuffXferProcessor.cpp |
| +++ b/src/gpu/effects/GrPorterDuffXferProcessor.cpp |
| @@ -799,8 +799,7 @@ void GrPorterDuffXPFactory::getInvariantBlendedColor(const GrProcOptInfo& colorP |
| } |
| bool GrPorterDuffXPFactory::onWillReadDstColor(const GrCaps& caps, |
| - const GrPipelineOptimizations& optimizations, |
| - bool hasMixedSamples) const { |
| + const GrPipelineOptimizations& optimizations) const { |
| if (caps.shaderCaps()->dualSourceBlendingSupport()) { |
| return false; |
| } |
| @@ -816,9 +815,12 @@ bool GrPorterDuffXPFactory::onWillReadDstColor(const GrCaps& caps, |
| } |
| return get_lcd_blend_formula(optimizations.fCoveragePOI, fXfermode).hasSecondaryOutput(); |
| } |
| + |
| // We fallback on the shader XP when the blend formula would use dual source blending but we |
| // don't have support for it. |
| - return get_blend_formula(optimizations.fColorPOI, optimizations.fCoveragePOI, hasMixedSamples, |
| + static const bool kHasMixedSamples = false; |
| + SkASSERT(!caps.usesMixedSamples()); // Dual source blending is a prerequisite for mixed samples. |
| + return get_blend_formula(optimizations.fColorPOI, optimizations.fCoveragePOI, kHasMixedSamples, |
| fXfermode).hasSecondaryOutput(); |
| } |
| @@ -897,8 +899,7 @@ GrXferProcessor* GrPorterDuffXPFactory::CreateSrcOverXferProcessor( |
| } |
| bool GrPorterDuffXPFactory::SrcOverWillNeedDstTexture(const GrCaps& caps, |
| - const GrPipelineOptimizations& optimizations, |
| - bool hasMixedSamples) { |
| + const GrPipelineOptimizations& optimizations) { |
| if (caps.shaderCaps()->dstReadInShaderSupport() || |
| caps.shaderCaps()->dualSourceBlendingSupport()) { |
| return false; |
| @@ -915,8 +916,11 @@ bool GrPorterDuffXPFactory::SrcOverWillNeedDstTexture(const GrCaps& caps, |
| return get_lcd_blend_formula(optimizations.fCoveragePOI, |
| SkXfermode::kSrcOver_Mode).hasSecondaryOutput(); |
| } |
| + |
| // We fallback on the shader XP when the blend formula would use dual source blending but we |
| // don't have support for it. |
| + static const bool kHasMixedSamples = false; |
| + SkASSERT(!caps.usesMixedSamples()); |
|
egdaniel
2016/05/05 20:04:56
can you add the same dual source blending comment
Chris Dalton
2016/05/06 16:06:50
Oops, I didn't notice I missed this one.
egdaniel
2016/05/06 16:10:04
Sounds good. Just wanted to make sure we had some
|
| return get_blend_formula(optimizations.fColorPOI, optimizations.fCoveragePOI, |
| - hasMixedSamples, SkXfermode::kSrcOver_Mode).hasSecondaryOutput(); |
| + kHasMixedSamples, SkXfermode::kSrcOver_Mode).hasSecondaryOutput(); |
| } |