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(drawType); | 168 this->didSetData(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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 for (int t = 0; t < numTransforms; ++t) { | 376 for (int t = 0; t < numTransforms; ++t) { |
376 const SkMatrix& transform = get_transform_matrix(proc, t); | 377 const SkMatrix& transform = get_transform_matrix(proc, t); |
377 GrGLPathRendering::PathTexGenComponents components = | 378 GrGLPathRendering::PathTexGenComponents components = |
378 GrGLPathRendering::kST_PathTexGenComponents; | 379 GrGLPathRendering::kST_PathTexGenComponents; |
379 if (proc.isPerspectiveCoordTransform(t)) { | 380 if (proc.isPerspectiveCoordTransform(t)) { |
380 components = GrGLPathRendering::kSTR_PathTexGenComponents; | 381 components = GrGLPathRendering::kSTR_PathTexGenComponents; |
381 } | 382 } |
382 fGpu->glPathRendering()->enablePathTexGen(texCoordIndex++, components, t
ransform); | 383 fGpu->glPathRendering()->enablePathTexGen(texCoordIndex++, components, t
ransform); |
383 } | 384 } |
384 } | 385 } |
OLD | NEW |