diff options
author | egdaniel <egdaniel@google.com> | 2015-09-22 10:10:55 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-09-22 10:10:55 -0700 |
commit | e73f1f6dfa665802a942e743a227b5c98bc958db (patch) | |
tree | a0f87be040eee052cad6cb8ecac4698df3864ede /src | |
parent | 7cbeaae8bb42c386145cd020f714f0eac8021dc2 (diff) |
Prefer dual source/framebuffer fetch paths for GPU LCD.
This will allow us to batch over color changes for LCD text.
BUG=skia:
Review URL: https://codereview.chromium.org/1354423002
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/effects/GrPorterDuffXferProcessor.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gpu/effects/GrPorterDuffXferProcessor.cpp b/src/gpu/effects/GrPorterDuffXferProcessor.cpp index 1312d35335..e31ff653f3 100644 --- a/src/gpu/effects/GrPorterDuffXferProcessor.cpp +++ b/src/gpu/effects/GrPorterDuffXferProcessor.cpp @@ -731,7 +731,11 @@ GrPorterDuffXPFactory::onCreateXferProcessor(const GrCaps& caps, BlendFormula blendFormula; if (covPOI.isFourChannelOutput()) { if (SkXfermode::kSrcOver_Mode == fXfermode && - kRGBA_GrColorComponentFlags == colorPOI.validFlags()) { + kRGBA_GrColorComponentFlags == colorPOI.validFlags() && + !caps.shaderCaps()->dualSourceBlendingSupport() && + !caps.shaderCaps()->dstReadInShaderSupport()) { + // If we don't have dual source blending or in shader dst reads, we fall back to this + // trick for rendering SrcOver LCD text instead of doing a dst copy. SkASSERT(!dstTexture || !dstTexture->texture()); return PDLCDXferProcessor::Create(fXfermode, colorPOI); } @@ -792,7 +796,8 @@ bool GrPorterDuffXPFactory::willReadDstColor(const GrCaps& caps, // the XP. if (covPOI.isFourChannelOutput()) { if (SkXfermode::kSrcOver_Mode == fXfermode && - kRGBA_GrColorComponentFlags == colorPOI.validFlags()) { + kRGBA_GrColorComponentFlags == colorPOI.validFlags() && + !caps.shaderCaps()->dstReadInShaderSupport()) { return false; } return get_lcd_blend_formula(covPOI, fXfermode).hasSecondaryOutput(); |