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

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

Issue 772513002: create and thread batch tracker object (Closed) Base URL: https://skia.googlesource.com/skia.git@2_vertex_attr
Patch Set: rebase Created 6 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') | 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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 verify(fp); 352 verify(fp);
353 fFragmentProcessors->fProcs.push_back(ifp); 353 fFragmentProcessors->fProcs.push_back(ifp);
354 } 354 }
355 355
356 void GrGLProgramBuilder::emitAndInstallProc(const GrGeometryProcessor& gp, 356 void GrGLProgramBuilder::emitAndInstallProc(const GrGeometryProcessor& gp,
357 const char* outColor, 357 const char* outColor,
358 const char* outCoverage) { 358 const char* outCoverage) {
359 SkASSERT(!fGeometryProcessor); 359 SkASSERT(!fGeometryProcessor);
360 fGeometryProcessor = SkNEW(GrGLInstalledGeoProc); 360 fGeometryProcessor = SkNEW(GrGLInstalledGeoProc);
361 361
362 fGeometryProcessor->fGLProc.reset(gp.getFactory().createGLInstance(gp)); 362 const GrBatchTracker& bt = fOptState.getBatchTracker();
363 fGeometryProcessor->fGLProc.reset(gp.getFactory().createGLInstance(gp, bt));
363 364
364 SkSTArray<4, GrGLProcessor::TextureSampler> samplers(gp.numTextures()); 365 SkSTArray<4, GrGLProcessor::TextureSampler> samplers(gp.numTextures());
365 this->emitSamplers(gp, &samplers, fGeometryProcessor); 366 this->emitSamplers(gp, &samplers, fGeometryProcessor);
366 367
367 GrGLGeometryProcessor::EmitArgs args(this, gp, outColor, outCoverage, sample rs); 368 GrGLGeometryProcessor::EmitArgs args(this, gp, bt, outColor, outCoverage, sa mplers);
368 fGeometryProcessor->fGLProc->emitCode(args); 369 fGeometryProcessor->fGLProc->emitCode(args);
369 370
370 // We have to check that effects and the code they emit are consistent, ie i f an effect 371 // We have to check that effects and the code they emit are consistent, ie i f an effect
371 // asks for dst color, then the emit code needs to follow suit 372 // asks for dst color, then the emit code needs to follow suit
372 verify(gp); 373 verify(gp);
373 } 374 }
374 375
375 void GrGLProgramBuilder::verify(const GrGeometryProcessor& gp) { 376 void GrGLProgramBuilder::verify(const GrGeometryProcessor& gp) {
376 SkASSERT(fFS.hasReadFragmentPosition() == gp.willReadFragmentPosition()); 377 SkASSERT(fFS.hasReadFragmentPosition() == gp.willReadFragmentPosition());
377 } 378 }
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 } 549 }
549 550
550 //////////////////////////////////////////////////////////////////////////////// /////////////////// 551 //////////////////////////////////////////////////////////////////////////////// ///////////////////
551 552
552 GrGLInstalledFragProcs::~GrGLInstalledFragProcs() { 553 GrGLInstalledFragProcs::~GrGLInstalledFragProcs() {
553 int numProcs = fProcs.count(); 554 int numProcs = fProcs.count();
554 for (int e = 0; e < numProcs; ++e) { 555 for (int e = 0; e < numProcs; ++e) {
555 SkDELETE(fProcs[e]); 556 SkDELETE(fProcs[e]);
556 } 557 }
557 } 558 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLProgramDesc.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698