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

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

Issue 666693012: GP Emit Code takes a struct (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 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/GrGLGeometryProcessor.h ('k') | no next file » | 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 #include "gl/GrGLProgram.h" 9 #include "gl/GrGLProgram.h"
10 #include "gl/GrGLSLPrettyPrint.h" 10 #include "gl/GrGLSLPrettyPrint.h"
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 const char* outColor, 306 const char* outColor,
307 const char* inColor) { 307 const char* inColor) {
308 SkASSERT(!fGeometryProcessor); 308 SkASSERT(!fGeometryProcessor);
309 fGeometryProcessor = SkNEW(GrGLInstalledGeoProc); 309 fGeometryProcessor = SkNEW(GrGLInstalledGeoProc);
310 310
311 fGeometryProcessor->fGLProc.reset(gp.getFactory().createGLInstance(gp)); 311 fGeometryProcessor->fGLProc.reset(gp.getFactory().createGLInstance(gp));
312 312
313 SkSTArray<4, GrGLProcessor::TextureSampler> samplers(gp.numTextures()); 313 SkSTArray<4, GrGLProcessor::TextureSampler> samplers(gp.numTextures());
314 this->emitSamplers(gp, &samplers, fGeometryProcessor); 314 this->emitSamplers(gp, &samplers, fGeometryProcessor);
315 315
316 SkSTArray<2, GrGLProcessor::TransformedCoords> coords; 316 GrGLGeometryProcessor::EmitArgs args(this, gp, key, outColor, inColor, sampl ers);
317 317 fGeometryProcessor->fGLProc->emitCode(args);
318 // TODO remove coords from emit code signature, probably best to use a struc t here so these
319 // updates are less painful
320 fGeometryProcessor->fGLProc->emitCode(this, gp, key, outColor, inColor, coor ds, samplers);
321 318
322 // We have to check that effects and the code they emit are consistent, ie i f an effect 319 // We have to check that effects and the code they emit are consistent, ie i f an effect
323 // asks for dst color, then the emit code needs to follow suit 320 // asks for dst color, then the emit code needs to follow suit
324 verify(gp); 321 verify(gp);
325 } 322 }
326 323
327 void GrGLProgramBuilder::verify(const GrGeometryProcessor& gp) { 324 void GrGLProgramBuilder::verify(const GrGeometryProcessor& gp) {
328 SkASSERT(fFS.hasReadFragmentPosition() == gp.willReadFragmentPosition()); 325 SkASSERT(fFS.hasReadFragmentPosition() == gp.willReadFragmentPosition());
329 } 326 }
330 327
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 } 503 }
507 504
508 //////////////////////////////////////////////////////////////////////////////// /////////////////// 505 //////////////////////////////////////////////////////////////////////////////// ///////////////////
509 506
510 GrGLInstalledFragProcs::~GrGLInstalledFragProcs() { 507 GrGLInstalledFragProcs::~GrGLInstalledFragProcs() {
511 int numProcs = fProcs.count(); 508 int numProcs = fProcs.count();
512 for (int e = 0; e < numProcs; ++e) { 509 for (int e = 0; e < numProcs; ++e) {
513 SkDELETE(fProcs[e]); 510 SkDELETE(fProcs[e]);
514 } 511 }
515 } 512 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLGeometryProcessor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698