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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « src/gpu/gl/GrGLProgramDesc.cpp ('k') | tests/ReadWriteAlphaTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrGLProgramBuilder.h" 8 #include "GrGLProgramBuilder.h"
9 9
10 #include "GrAutoLocaleSetter.h" 10 #include "GrAutoLocaleSetter.h"
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 ignoresCoverage ? nullptr : coverageIn.c_ str(), 253 ignoresCoverage ? nullptr : coverageIn.c_ str(),
254 fFS.getPrimaryColorOutputName(), 254 fFS.getPrimaryColorOutputName(),
255 fFS.getSecondaryColorOutputName(), 255 fFS.getSecondaryColorOutputName(),
256 samplers); 256 samplers);
257 fXferProcessor->fGLProc->emitCode(args); 257 fXferProcessor->fGLProc->emitCode(args);
258 258
259 // We have to check that effects and the code they emit are consistent, ie i f an effect 259 // We have to check that effects and the code they emit are consistent, ie i f an effect
260 // asks for dst color, then the emit code needs to follow suit 260 // asks for dst color, then the emit code needs to follow suit
261 verify(xp); 261 verify(xp);
262 fFS.codeAppend("}"); 262 fFS.codeAppend("}");
263
264 if (this->desc().header().fSwapDstRedAndAlpha) {
265 fFS.codeAppendf("%s = %s.agbr;", fFS.getPrimaryColorOutputName(),
266 fFS.getPrimaryColorOutputName());
267 if (xp.hasSecondaryOutput()) {
268 fFS.codeAppendf("%s = %s.agbr;", fFS.getSecondaryColorOutputName(),
269 fFS.getSecondaryColorOutputName());
270 }
271 }
263 } 272 }
264 273
265 void GrGLProgramBuilder::verify(const GrPrimitiveProcessor& gp) { 274 void GrGLProgramBuilder::verify(const GrPrimitiveProcessor& gp) {
266 SkASSERT(fFS.hasReadFragmentPosition() == gp.willReadFragmentPosition()); 275 SkASSERT(fFS.hasReadFragmentPosition() == gp.willReadFragmentPosition());
267 } 276 }
268 277
269 void GrGLProgramBuilder::verify(const GrXferProcessor& xp) { 278 void GrGLProgramBuilder::verify(const GrXferProcessor& xp) {
270 SkASSERT(fFS.hasReadDstColor() == xp.willReadDstColor()); 279 SkASSERT(fFS.hasReadDstColor() == xp.willReadDstColor());
271 } 280 }
272 281
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 } 487 }
479 488
480 //////////////////////////////////////////////////////////////////////////////// /////////////////// 489 //////////////////////////////////////////////////////////////////////////////// ///////////////////
481 490
482 GrGLInstalledFragProcs::~GrGLInstalledFragProcs() { 491 GrGLInstalledFragProcs::~GrGLInstalledFragProcs() {
483 int numProcs = fProcs.count(); 492 int numProcs = fProcs.count();
484 for (int i = 0; i < numProcs; ++i) { 493 for (int i = 0; i < numProcs; ++i) {
485 delete fProcs[i]; 494 delete fProcs[i];
486 } 495 }
487 } 496 }
OLDNEW
« 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