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

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

Issue 1604313002: Make GrGLProgramBuilder a local stack variable in CreateProgram (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 | « no previous file | 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 9
10 #include "GrAutoLocaleSetter.h" 10 #include "GrAutoLocaleSetter.h"
(...skipping 15 matching lines...) Expand all
26 #include "glsl/GrGLSLXferProcessor.h" 26 #include "glsl/GrGLSLXferProcessor.h"
27 27
28 #define GL_CALL(X) GR_GL_CALL(this->gpu()->glInterface(), X) 28 #define GL_CALL(X) GR_GL_CALL(this->gpu()->glInterface(), X)
29 #define GL_CALL_RET(R, X) GR_GL_CALL_RET(this->gpu()->glInterface(), R, X) 29 #define GL_CALL_RET(R, X) GR_GL_CALL_RET(this->gpu()->glInterface(), R, X)
30 30
31 GrGLProgram* GrGLProgramBuilder::CreateProgram(const DrawArgs& args, GrGLGpu* gp u) { 31 GrGLProgram* GrGLProgramBuilder::CreateProgram(const DrawArgs& args, GrGLGpu* gp u) {
32 GrAutoLocaleSetter als("C"); 32 GrAutoLocaleSetter als("C");
33 33
34 // create a builder. This will be handed off to effects so they can use it to add 34 // create a builder. This will be handed off to effects so they can use it to add
35 // uniforms, varyings, textures, etc 35 // uniforms, varyings, textures, etc
36 SkAutoTDelete<GrGLProgramBuilder> builder(new GrGLProgramBuilder(gpu, args)) ; 36 GrGLProgramBuilder builder(gpu, args);
37
38 GrGLProgramBuilder* pb = builder.get();
39 37
40 // TODO: Once all stages can handle taking a float or vec4 and correctly han dling them we can 38 // TODO: Once all stages can handle taking a float or vec4 and correctly han dling them we can
41 // seed correctly here 39 // seed correctly here
42 GrGLSLExpr4 inputColor; 40 GrGLSLExpr4 inputColor;
43 GrGLSLExpr4 inputCoverage; 41 GrGLSLExpr4 inputCoverage;
44 42
45 if (!pb->emitAndInstallProcs(&inputColor, 43 if (!builder.emitAndInstallProcs(&inputColor,
46 &inputCoverage, 44 &inputCoverage,
47 gpu->glCaps().maxFragmentTextureUnits())) { 45 gpu->glCaps().maxFragmentTextureUnits())) {
48 pb->cleanupFragmentProcessors(); 46 builder.cleanupFragmentProcessors();
49 return nullptr; 47 return nullptr;
50 } 48 }
51 49
52 return pb->finalize(); 50 return builder.finalize();
53 } 51 }
54 52
55 ///////////////////////////////////////////////////////////////////////////// 53 /////////////////////////////////////////////////////////////////////////////
56 54
57 GrGLProgramBuilder::GrGLProgramBuilder(GrGLGpu* gpu, const DrawArgs& args) 55 GrGLProgramBuilder::GrGLProgramBuilder(GrGLGpu* gpu, const DrawArgs& args)
58 : INHERITED(args) 56 : INHERITED(args)
59 , fGpu(gpu) 57 , fGpu(gpu)
60 , fSamplerUniforms(4) 58 , fSamplerUniforms(4)
61 , fVaryingHandler(this) 59 , fVaryingHandler(this)
62 , fUniformHandler(this) { 60 , fUniformHandler(this) {
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 fUniformHandles, 265 fUniformHandles,
268 programID, 266 programID,
269 fUniformHandler.fUniforms, 267 fUniformHandler.fUniforms,
270 fVaryingHandler.fPathProcVaryingInfos, 268 fVaryingHandler.fPathProcVaryingInfos,
271 fGeometryProcessor, 269 fGeometryProcessor,
272 fXferProcessor, 270 fXferProcessor,
273 fFragmentProcessors, 271 fFragmentProcessors,
274 &fSamplerUniforms); 272 &fSamplerUniforms);
275 } 273 }
276 274
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698