OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |