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

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

Issue 1251173002: Added GrGLFragmentProcessor::EmitArgs struct for use with emitCode() (Closed) Base URL: https://skia.googlesource.com/skia@composeshader_gpu
Patch Set: Created 5 years, 5 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/GrGLFragmentProcessor.h ('k') | tests/GLProgramsTest.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 "gl/GrGLGeometryProcessor.h" 10 #include "gl/GrGLGeometryProcessor.h"
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 const char* outColor, 279 const char* outColor,
280 const char* inColor) { 280 const char* inColor) {
281 GrGLInstalledFragProc* ifp = SkNEW(GrGLInstalledFragProc); 281 GrGLInstalledFragProc* ifp = SkNEW(GrGLInstalledFragProc);
282 282
283 const GrFragmentProcessor& fp = *fs.processor(); 283 const GrFragmentProcessor& fp = *fs.processor();
284 ifp->fGLProc.reset(fp.createGLInstance()); 284 ifp->fGLProc.reset(fp.createGLInstance());
285 285
286 SkSTArray<4, GrGLProcessor::TextureSampler> samplers(fp.numTextures()); 286 SkSTArray<4, GrGLProcessor::TextureSampler> samplers(fp.numTextures());
287 this->emitSamplers(fp, &samplers, ifp); 287 this->emitSamplers(fp, &samplers, ifp);
288 288
289 ifp->fGLProc->emitCode(this, fp, outColor, inColor, fOutCoords[index], sampl ers); 289 GrGLFragmentProcessor::EmitArgs args(this, fp, outColor, inColor, fOutCoords [index], samplers);
290 ifp->fGLProc->emitCode(args);
290 291
291 // We have to check that effects and the code they emit are consistent, ie i f an effect 292 // We have to check that effects and the code they emit are consistent, ie i f an effect
292 // asks for dst color, then the emit code needs to follow suit 293 // asks for dst color, then the emit code needs to follow suit
293 verify(fp); 294 verify(fp);
294 fFragmentProcessors->fProcs.push_back(ifp); 295 fFragmentProcessors->fProcs.push_back(ifp);
295 } 296 }
296 297
297 void GrGLProgramBuilder::emitAndInstallProc(const GrPrimitiveProcessor& gp, 298 void GrGLProgramBuilder::emitAndInstallProc(const GrPrimitiveProcessor& gp,
298 const char* outColor, 299 const char* outColor,
299 const char* outCoverage) { 300 const char* outCoverage) {
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 } 496 }
496 497
497 //////////////////////////////////////////////////////////////////////////////// /////////////////// 498 //////////////////////////////////////////////////////////////////////////////// ///////////////////
498 499
499 GrGLInstalledFragProcs::~GrGLInstalledFragProcs() { 500 GrGLInstalledFragProcs::~GrGLInstalledFragProcs() {
500 int numProcs = fProcs.count(); 501 int numProcs = fProcs.count();
501 for (int e = 0; e < numProcs; ++e) { 502 for (int e = 0; e < numProcs; ++e) {
502 SkDELETE(fProcs[e]); 503 SkDELETE(fProcs[e]);
503 } 504 }
504 } 505 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLFragmentProcessor.h ('k') | tests/GLProgramsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698