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

Side by Side Diff: src/gpu/gl/builders/GrGLProgramBuilder.cpp

Issue 1576023002: Make readback of alpha channel work for RGBA. (Closed) Base URL: https://skia.googlesource.com/skia.git@swiz
Patch Set: more Created 4 years, 11 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 unified diff | Download patch
« no previous file with comments | « src/gpu/gl/GrGLProgramDesc.cpp ('k') | src/gpu/glsl/GrGLSLCaps.h » ('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 GrSwizzle swizzle;
265 swizzle.setFromKey(this->desc().header().fOutputSwizzle);
266 if (swizzle != GrSwizzle::RGBA()) {
267 fFS.codeAppendf("%s = %s.%s;", fFS.getPrimaryColorOutputName(),
268 fFS.getPrimaryColorOutputName(),
269 swizzle.c_str());
270 if (xp.hasSecondaryOutput()) {
271 fFS.codeAppendf("%s = %s.%s;", fFS.getSecondaryColorOutputName(),
272 fFS.getSecondaryColorOutputName(),
273 swizzle.c_str());
274 }
275 }
263 } 276 }
264 277
265 void GrGLProgramBuilder::verify(const GrPrimitiveProcessor& gp) { 278 void GrGLProgramBuilder::verify(const GrPrimitiveProcessor& gp) {
266 SkASSERT(fFS.hasReadFragmentPosition() == gp.willReadFragmentPosition()); 279 SkASSERT(fFS.hasReadFragmentPosition() == gp.willReadFragmentPosition());
267 } 280 }
268 281
269 void GrGLProgramBuilder::verify(const GrXferProcessor& xp) { 282 void GrGLProgramBuilder::verify(const GrXferProcessor& xp) {
270 SkASSERT(fFS.hasReadDstColor() == xp.willReadDstColor()); 283 SkASSERT(fFS.hasReadDstColor() == xp.willReadDstColor());
271 } 284 }
272 285
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 } 491 }
479 492
480 //////////////////////////////////////////////////////////////////////////////// /////////////////// 493 //////////////////////////////////////////////////////////////////////////////// ///////////////////
481 494
482 GrGLInstalledFragProcs::~GrGLInstalledFragProcs() { 495 GrGLInstalledFragProcs::~GrGLInstalledFragProcs() {
483 int numProcs = fProcs.count(); 496 int numProcs = fProcs.count();
484 for (int i = 0; i < numProcs; ++i) { 497 for (int i = 0; i < numProcs; ++i) {
485 delete fProcs[i]; 498 delete fProcs[i];
486 } 499 }
487 } 500 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLProgramDesc.cpp ('k') | src/gpu/glsl/GrGLSLCaps.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698