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 const GrBatchTracker& bt = optState.getBatchTracker(); | 161 fGeometryProcessor->fGLProc->setData(fProgramDataManager, gp); |
162 fGeometryProcessor->fGLProc->setData(fProgramDataManager, gp, bt); | |
163 this->bindTextures(fGeometryProcessor, gp); | 162 this->bindTextures(fGeometryProcessor, gp); |
164 } | 163 } |
165 this->setFragmentData(optState); | 164 this->setFragmentData(optState); |
166 | 165 |
167 // Some of GrGLProgram subclasses need to update state here | 166 // Some of GrGLProgram subclasses need to update state here |
168 this->didSetData(optState.drawType()); | 167 this->didSetData(optState.drawType()); |
169 } | 168 } |
170 | 169 |
171 void GrGLProgram::setFragmentData(const GrOptDrawState& optState) { | 170 void GrGLProgram::setFragmentData(const GrOptDrawState& optState) { |
172 int numProcessors = fFragmentProcessors->fProcs.count(); | 171 int numProcessors = fFragmentProcessors->fProcs.count(); |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 for (int t = 0; t < numTransforms; ++t) { | 372 for (int t = 0; t < numTransforms; ++t) { |
374 const SkMatrix& transform = get_transform_matrix(proc, t); | 373 const SkMatrix& transform = get_transform_matrix(proc, t); |
375 GrGLPathRendering::PathTexGenComponents components = | 374 GrGLPathRendering::PathTexGenComponents components = |
376 GrGLPathRendering::kST_PathTexGenComponents; | 375 GrGLPathRendering::kST_PathTexGenComponents; |
377 if (proc.isPerspectiveCoordTransform(t)) { | 376 if (proc.isPerspectiveCoordTransform(t)) { |
378 components = GrGLPathRendering::kSTR_PathTexGenComponents; | 377 components = GrGLPathRendering::kSTR_PathTexGenComponents; |
379 } | 378 } |
380 fGpu->glPathRendering()->enablePathTexGen(texCoordIndex++, components, t
ransform); | 379 fGpu->glPathRendering()->enablePathTexGen(texCoordIndex++, components, t
ransform); |
381 } | 380 } |
382 } | 381 } |
OLD | NEW |