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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 SkASSERT(!fBuiltinUniformHandles.fDstCopyTopLeftUni.isValid()); | 151 SkASSERT(!fBuiltinUniformHandles.fDstCopyTopLeftUni.isValid()); |
152 SkASSERT(!fBuiltinUniformHandles.fDstCopyScaleUni.isValid()); | 152 SkASSERT(!fBuiltinUniformHandles.fDstCopyScaleUni.isValid()); |
153 SkASSERT(!fBuiltinUniformHandles.fDstCopySamplerUni.isValid()); | 153 SkASSERT(!fBuiltinUniformHandles.fDstCopySamplerUni.isValid()); |
154 } | 154 } |
155 | 155 |
156 // we set the textures, and uniforms for installed processors in a generic w
ay, but subclasses | 156 // we set the textures, and uniforms for installed processors in a generic w
ay, but subclasses |
157 // of GLProgram determine how to set coord transforms | 157 // of GLProgram determine how to set coord transforms |
158 if (fGeometryProcessor.get()) { | 158 if (fGeometryProcessor.get()) { |
159 SkASSERT(optState.hasGeometryProcessor()); | 159 SkASSERT(optState.hasGeometryProcessor()); |
160 const GrGeometryProcessor& gp = *optState.getGeometryProcessor(); | 160 const GrGeometryProcessor& gp = *optState.getGeometryProcessor(); |
161 fGeometryProcessor->fGLProc->setData(fProgramDataManager, gp); | 161 const GrBatchTracker& bt = optState.getBatchTracker(); |
| 162 fGeometryProcessor->fGLProc->setData(fProgramDataManager, gp, bt); |
162 this->bindTextures(fGeometryProcessor, gp); | 163 this->bindTextures(fGeometryProcessor, gp); |
163 } | 164 } |
164 this->setFragmentData(optState); | 165 this->setFragmentData(optState); |
165 | 166 |
166 // Some of GrGLProgram subclasses need to update state here | 167 // Some of GrGLProgram subclasses need to update state here |
167 this->didSetData(optState.drawType()); | 168 this->didSetData(optState.drawType()); |
168 } | 169 } |
169 | 170 |
170 void GrGLProgram::setFragmentData(const GrOptDrawState& optState) { | 171 void GrGLProgram::setFragmentData(const GrOptDrawState& optState) { |
171 int numProcessors = fFragmentProcessors->fProcs.count(); | 172 int numProcessors = fFragmentProcessors->fProcs.count(); |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 for (int t = 0; t < numTransforms; ++t) { | 373 for (int t = 0; t < numTransforms; ++t) { |
373 const SkMatrix& transform = get_transform_matrix(proc, t); | 374 const SkMatrix& transform = get_transform_matrix(proc, t); |
374 GrGLPathRendering::PathTexGenComponents components = | 375 GrGLPathRendering::PathTexGenComponents components = |
375 GrGLPathRendering::kST_PathTexGenComponents; | 376 GrGLPathRendering::kST_PathTexGenComponents; |
376 if (proc.isPerspectiveCoordTransform(t)) { | 377 if (proc.isPerspectiveCoordTransform(t)) { |
377 components = GrGLPathRendering::kSTR_PathTexGenComponents; | 378 components = GrGLPathRendering::kSTR_PathTexGenComponents; |
378 } | 379 } |
379 fGpu->glPathRendering()->enablePathTexGen(texCoordIndex++, components, t
ransform); | 380 fGpu->glPathRendering()->enablePathTexGen(texCoordIndex++, components, t
ransform); |
380 } | 381 } |
381 } | 382 } |
OLD | NEW |