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

Side by Side Diff: src/gpu/gl/GrGLProgram.cpp

Issue 1287023009: Added tree structure to GrGLFragmentProcessor, i.e. GL instances (Closed) Base URL: https://skia.googlesource.com/skia@cs3_isequal_nonrecursive
Patch Set: moved onSetData from public to protected, onCreateGLInstance from public to private in subclasses Created 5 years, 4 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.cpp ('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 2011 Google Inc. 2 * Copyright 2011 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 "GrGLProgram.h" 8 #include "GrGLProgram.h"
9 9
10 #include "GrAllocator.h" 10 #include "GrAllocator.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 // Some of GrGLProgram subclasses need to update state here 100 // Some of GrGLProgram subclasses need to update state here
101 this->didSetData(); 101 this->didSetData();
102 } 102 }
103 103
104 void GrGLProgram::setFragmentData(const GrPrimitiveProcessor& primProc, 104 void GrGLProgram::setFragmentData(const GrPrimitiveProcessor& primProc,
105 const GrPipeline& pipeline, 105 const GrPipeline& pipeline,
106 SkTArray<const GrTextureAccess*>* textureBindi ngs) { 106 SkTArray<const GrTextureAccess*>* textureBindi ngs) {
107 int numProcessors = fFragmentProcessors->fProcs.count(); 107 int numProcessors = fFragmentProcessors->fProcs.count();
108 for (int e = 0; e < numProcessors; ++e) { 108 for (int e = 0; e < numProcessors; ++e) {
109 const GrPendingFragmentStage& stage = pipeline.getFragmentStage(e); 109 const GrPendingFragmentStage& stage = pipeline.getFragmentStage(e);
110 const GrProcessor& processor = *stage.processor(); 110 const GrFragmentProcessor& processor = *stage.processor();
111 fFragmentProcessors->fProcs[e]->fGLProc->setData(fProgramDataManager, pr ocessor); 111 fFragmentProcessors->fProcs[e]->fGLProc->setData(fProgramDataManager, pr ocessor);
112 this->setTransformData(primProc, 112 this->setTransformData(primProc,
113 stage, 113 stage,
114 e, 114 e,
115 fFragmentProcessors->fProcs[e]); 115 fFragmentProcessors->fProcs[e]);
116 append_texture_bindings(fFragmentProcessors->fProcs[e], processor, textu reBindings); 116 append_texture_bindings(fFragmentProcessors->fProcs[e], processor, textu reBindings);
117 } 117 }
118 } 118 }
119 void GrGLProgram::setTransformData(const GrPrimitiveProcessor& primProc, 119 void GrGLProgram::setTransformData(const GrPrimitiveProcessor& primProc,
120 const GrPendingFragmentStage& processor, 120 const GrPendingFragmentStage& processor,
(...skipping 27 matching lines...) Expand all
148 fRenderTargetState.fRenderTargetSize != size) { 148 fRenderTargetState.fRenderTargetSize != size) {
149 fRenderTargetState.fRenderTargetSize = size; 149 fRenderTargetState.fRenderTargetSize = size;
150 fRenderTargetState.fRenderTargetOrigin = rt->origin(); 150 fRenderTargetState.fRenderTargetOrigin = rt->origin();
151 151
152 GrGLfloat rtAdjustmentVec[4]; 152 GrGLfloat rtAdjustmentVec[4];
153 fRenderTargetState.getRTAdjustmentVec(rtAdjustmentVec); 153 fRenderTargetState.getRTAdjustmentVec(rtAdjustmentVec);
154 fProgramDataManager.set4fv(fBuiltinUniformHandles.fRTAdjustmentUni, 1, r tAdjustmentVec); 154 fProgramDataManager.set4fv(fBuiltinUniformHandles.fRTAdjustmentUni, 1, r tAdjustmentVec);
155 } 155 }
156 } 156 }
157 157
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLFragmentProcessor.cpp ('k') | tests/GLProgramsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698