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

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

Issue 674543004: OptState owns program descriptor (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
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 "GrGLNvprProgramBuilder.h" 8 #include "GrGLNvprProgramBuilder.h"
9 #include "../GrGpuGL.h" 9 #include "../GrGpuGL.h"
10 10
11 #define GL_CALL(X) GR_GL_CALL(this->gpu()->glInterface(), X) 11 #define GL_CALL(X) GR_GL_CALL(this->gpu()->glInterface(), X)
12 #define GL_CALL_RET(R, X) GR_GL_CALL_RET(this->gpu()->glInterface(), R, X) 12 #define GL_CALL_RET(R, X) GR_GL_CALL_RET(this->gpu()->glInterface(), R, X)
13 13
14 GrGLNvprProgramBuilder::GrGLNvprProgramBuilder(GrGpuGL* gpu, 14 GrGLNvprProgramBuilder::GrGLNvprProgramBuilder(GrGpuGL* gpu,
15 const GrOptDrawState& optState, 15 const GrOptDrawState& optState)
16 const GrGLProgramDesc& desc) 16 : INHERITED(gpu, optState)
17 : INHERITED(gpu, optState, desc)
18 , fSeparableVaryingInfos(kVarsPerBlock) { 17 , fSeparableVaryingInfos(kVarsPerBlock) {
19 } 18 }
20 19
21 void GrGLNvprProgramBuilder::emitTransforms(const GrFragmentStage& processorStag e, 20 void GrGLNvprProgramBuilder::emitTransforms(const GrFragmentStage& processorStag e,
22 GrGLProcessor::TransformedCoordsArra y* outCoords, 21 GrGLProcessor::TransformedCoordsArra y* outCoords,
23 GrGLInstalledFragProc* ifp) { 22 GrGLInstalledFragProc* ifp) {
24 const GrFragmentProcessor* effect = processorStage.getProcessor(); 23 const GrFragmentProcessor* effect = processorStage.getProcessor();
25 int numTransforms = effect->numTransforms(); 24 int numTransforms = effect->numTransforms();
26 25
27 ifp->fTransforms.push_back_n(numTransforms); 26 ifp->fTransforms.push_back_n(numTransforms);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 } 72 }
74 } 73 }
75 74
76 GrGLProgram* GrGLNvprProgramBuilder::createProgram(GrGLuint programID) { 75 GrGLProgram* GrGLNvprProgramBuilder::createProgram(GrGLuint programID) {
77 // this is just for nvpr es, which has separable varyings that are plugged i n after 76 // this is just for nvpr es, which has separable varyings that are plugged i n after
78 // building 77 // building
79 this->resolveSeparableVaryings(programID); 78 this->resolveSeparableVaryings(programID);
80 return SkNEW_ARGS(GrGLNvprProgram, (fGpu, fDesc, fUniformHandles, programID, fUniforms, 79 return SkNEW_ARGS(GrGLNvprProgram, (fGpu, fDesc, fUniformHandles, programID, fUniforms,
81 fFragmentProcessors.get(), fSeparableVar yingInfos)); 80 fFragmentProcessors.get(), fSeparableVar yingInfos));
82 } 81 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698