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

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

Issue 1354423002: Prefer dual source/framebuffer fetch paths for GPU LCD. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update comment Created 5 years, 3 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 | no next file » | 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 1312d353351d1bf9eaba46395712fac5cd01e052..e31ff653f3f4ea519d78d7c3aab23edd6847eb84 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();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698