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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 SkTArray<const GrTextureAccess*>* textureBindings) { | 82 SkTArray<const GrTextureAccess*>* textureBindings) { |
83 this->setRenderTargetState(primProc, pipeline); | 83 this->setRenderTargetState(primProc, pipeline); |
84 | 84 |
85 // we set the textures, and uniforms for installed processors in a generic w
ay, but subclasses | 85 // we set the textures, and uniforms for installed processors in a generic w
ay, but subclasses |
86 // of GLProgram determine how to set coord transforms | 86 // of GLProgram determine how to set coord transforms |
87 fGeometryProcessor->setData(fProgramDataManager, primProc); | 87 fGeometryProcessor->setData(fProgramDataManager, primProc); |
88 append_texture_bindings(primProc, textureBindings); | 88 append_texture_bindings(primProc, textureBindings); |
89 | 89 |
90 this->setFragmentData(primProc, pipeline, textureBindings); | 90 this->setFragmentData(primProc, pipeline, textureBindings); |
91 | 91 |
92 if (primProc.getPixelLocalStorageState() != | 92 if (primProc.getPixelLocalStorageState() != |
93 GrPixelLocalStorageState::kDraw_GrPixelLocalStorageState) { | 93 GrPixelLocalStorageState::kDraw_GrPixelLocalStorageState) { |
94 const GrXferProcessor& xp = pipeline.getXferProcessor(); | 94 const GrXferProcessor& xp = pipeline.getXferProcessor(); |
95 fXferProcessor->setData(fProgramDataManager, xp); | 95 fXferProcessor->setData(fProgramDataManager, xp); |
96 append_texture_bindings(xp, textureBindings); | 96 append_texture_bindings(xp, textureBindings); |
97 } | 97 } |
98 } | 98 } |
99 | 99 |
100 void GrGLProgram::setFragmentData(const GrPrimitiveProcessor& primProc, | 100 void GrGLProgram::setFragmentData(const GrPrimitiveProcessor& primProc, |
101 const GrPipeline& pipeline, | 101 const GrPipeline& pipeline, |
102 SkTArray<const GrTextureAccess*>* textureBindi
ngs) { | 102 SkTArray<const GrTextureAccess*>* textureBindi
ngs) { |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 fRenderTargetState.getRTAdjustmentVec(rtAdjustmentVec); | 138 fRenderTargetState.getRTAdjustmentVec(rtAdjustmentVec); |
139 fProgramDataManager.set4fv(fBuiltinUniformHandles.fRTAdjustmentUni,
1, rtAdjustmentVec); | 139 fProgramDataManager.set4fv(fBuiltinUniformHandles.fRTAdjustmentUni,
1, rtAdjustmentVec); |
140 } | 140 } |
141 } else { | 141 } else { |
142 SkASSERT(fGpu->glCaps().shaderCaps()->pathRenderingSupport()); | 142 SkASSERT(fGpu->glCaps().shaderCaps()->pathRenderingSupport()); |
143 const GrPathProcessor& pathProc = primProc.cast<GrPathProcessor>(); | 143 const GrPathProcessor& pathProc = primProc.cast<GrPathProcessor>(); |
144 fGpu->glPathRendering()->setProjectionMatrix(pathProc.viewMatrix(), | 144 fGpu->glPathRendering()->setProjectionMatrix(pathProc.viewMatrix(), |
145 size, rt->origin()); | 145 size, rt->origin()); |
146 } | 146 } |
147 } | 147 } |
OLD | NEW |