| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 const GrTextureAccess** bindings = textureBindings->push_back_n(numTextu
res); | 75 const GrTextureAccess** bindings = textureBindings->push_back_n(numTextu
res); |
| 76 int i = 0; | 76 int i = 0; |
| 77 do { | 77 do { |
| 78 bindings[i] = &processor.textureAccess(i); | 78 bindings[i] = &processor.textureAccess(i); |
| 79 } while (++i < numTextures); | 79 } while (++i < numTextures); |
| 80 } | 80 } |
| 81 } | 81 } |
| 82 | 82 |
| 83 void GrGLProgram::setData(const GrPrimitiveProcessor& primProc, | 83 void GrGLProgram::setData(const GrPrimitiveProcessor& primProc, |
| 84 const GrPipeline& pipeline, | 84 const GrPipeline& pipeline, |
| 85 const GrBatchTracker& batchTracker, | |
| 86 SkTArray<const GrTextureAccess*>* textureBindings) { | 85 SkTArray<const GrTextureAccess*>* textureBindings) { |
| 87 this->setRenderTargetState(primProc, pipeline); | 86 this->setRenderTargetState(primProc, pipeline); |
| 88 | 87 |
| 89 // we set the textures, and uniforms for installed processors in a generic w
ay, but subclasses | 88 // we set the textures, and uniforms for installed processors in a generic w
ay, but subclasses |
| 90 // of GLProgram determine how to set coord transforms | 89 // of GLProgram determine how to set coord transforms |
| 91 fGeometryProcessor->fGLProc->setData(fProgramDataManager, primProc, batchTra
cker); | 90 fGeometryProcessor->fGLProc->setData(fProgramDataManager, primProc); |
| 92 append_texture_bindings(fGeometryProcessor.get(), primProc, textureBindings)
; | 91 append_texture_bindings(fGeometryProcessor.get(), primProc, textureBindings)
; |
| 93 | 92 |
| 94 this->setFragmentData(primProc, pipeline, textureBindings); | 93 this->setFragmentData(primProc, pipeline, textureBindings); |
| 95 | 94 |
| 96 const GrXferProcessor& xp = *pipeline.getXferProcessor(); | 95 const GrXferProcessor& xp = *pipeline.getXferProcessor(); |
| 97 fXferProcessor->fGLProc->setData(fProgramDataManager, xp); | 96 fXferProcessor->fGLProc->setData(fProgramDataManager, xp); |
| 98 append_texture_bindings(fXferProcessor.get(), xp, textureBindings); | 97 append_texture_bindings(fXferProcessor.get(), xp, textureBindings); |
| 99 | 98 |
| 100 // Some of GrGLProgram subclasses need to update state here | 99 // Some of GrGLProgram subclasses need to update state here |
| 101 this->didSetData(); | 100 this->didSetData(); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 fRenderTargetState.fRenderTargetSize != size) { | 146 fRenderTargetState.fRenderTargetSize != size) { |
| 148 fRenderTargetState.fRenderTargetSize = size; | 147 fRenderTargetState.fRenderTargetSize = size; |
| 149 fRenderTargetState.fRenderTargetOrigin = rt->origin(); | 148 fRenderTargetState.fRenderTargetOrigin = rt->origin(); |
| 150 | 149 |
| 151 GrGLfloat rtAdjustmentVec[4]; | 150 GrGLfloat rtAdjustmentVec[4]; |
| 152 fRenderTargetState.getRTAdjustmentVec(rtAdjustmentVec); | 151 fRenderTargetState.getRTAdjustmentVec(rtAdjustmentVec); |
| 153 fProgramDataManager.set4fv(fBuiltinUniformHandles.fRTAdjustmentUni, 1, r
tAdjustmentVec); | 152 fProgramDataManager.set4fv(fBuiltinUniformHandles.fRTAdjustmentUni, 1, r
tAdjustmentVec); |
| 154 } | 153 } |
| 155 } | 154 } |
| 156 | 155 |
| OLD | NEW |