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

Unified Diff: src/gpu/gl/builders/GrGLProgramBuilder.cpp

Issue 1530713002: make alpha read back of bgra/rgba work (Closed) Base URL: https://skia.googlesource.com/skia.git@align
Patch Set: cleanup Created 5 years 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 | « src/gpu/gl/GrGLProgramDesc.cpp ('k') | tests/ReadWriteAlphaTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/builders/GrGLProgramBuilder.cpp
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.cpp b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
index dc9393db0739ea04c5acd824c903d2eb8b6f7720..6e09d701b672f5017e82ca00bfee5448043c3066 100644
--- a/src/gpu/gl/builders/GrGLProgramBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
@@ -260,6 +260,15 @@ void GrGLProgramBuilder::emitAndInstallXferProc(const GrXferProcessor& xp,
// asks for dst color, then the emit code needs to follow suit
verify(xp);
fFS.codeAppend("}");
+
+ if (this->desc().header().fSwapDstRedAndAlpha) {
+ fFS.codeAppendf("%s = %s.agbr;", fFS.getPrimaryColorOutputName(),
+ fFS.getPrimaryColorOutputName());
+ if (xp.hasSecondaryOutput()) {
+ fFS.codeAppendf("%s = %s.agbr;", fFS.getSecondaryColorOutputName(),
+ fFS.getSecondaryColorOutputName());
+ }
+ }
}
void GrGLProgramBuilder::verify(const GrPrimitiveProcessor& gp) {
« no previous file with comments | « src/gpu/gl/GrGLProgramDesc.cpp ('k') | tests/ReadWriteAlphaTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698