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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 fRenderTargetState.fRenderTargetSize != size) { | 165 fRenderTargetState.fRenderTargetSize != size) { |
166 fRenderTargetState.fRenderTargetSize = size; | 166 fRenderTargetState.fRenderTargetSize = size; |
167 fRenderTargetState.fRenderTargetOrigin = rt->origin(); | 167 fRenderTargetState.fRenderTargetOrigin = rt->origin(); |
168 | 168 |
169 GrGLfloat rtAdjustmentVec[4]; | 169 GrGLfloat rtAdjustmentVec[4]; |
170 fRenderTargetState.getRTAdjustmentVec(rtAdjustmentVec); | 170 fRenderTargetState.getRTAdjustmentVec(rtAdjustmentVec); |
171 fProgramDataManager.set4fv(fBuiltinUniformHandles.fRTAdjustmentUni, 1, r
tAdjustmentVec); | 171 fProgramDataManager.set4fv(fBuiltinUniformHandles.fRTAdjustmentUni, 1, r
tAdjustmentVec); |
172 } | 172 } |
173 } | 173 } |
174 | 174 |
175 ////////////////////////////////////////////////////////////////////////////////
///////// | |
176 | |
177 GrGLNvprProgram::GrGLNvprProgram(GrGLGpu* gpu, | |
178 const GrProgramDesc& desc, | |
179 const BuiltinUniformHandles& builtinUniforms, | |
180 GrGLuint programID, | |
181 const UniformInfoArray& uniforms, | |
182 GrGLInstalledGeoProc* primProc, | |
183 GrGLInstalledXferProc* xferProcessor, | |
184 GrGLInstalledFragProcs* fragmentProcessors) | |
185 : INHERITED(gpu, desc, builtinUniforms, programID, uniforms, primProc, | |
186 xferProcessor, fragmentProcessors) { | |
187 } | |
188 void GrGLNvprProgram::didSetData() { | |
189 GrGLPathProcessor* pathProc = | |
190 static_cast<GrGLPathProcessor*>(fGeometryProcessor.get()->fGLProc.ge
t()); | |
191 pathProc->didSetData(fGpu->glPathRendering()); | |
192 } | |
193 | |
194 void GrGLNvprProgram::setTransformData(const GrPrimitiveProcessor& primProc, | |
195 const GrPendingFragmentStage& proc, | |
196 int index, | |
197 GrGLInstalledFragProc* ip) { | |
198 GrGLPathProcessor* pathProc = | |
199 static_cast<GrGLPathProcessor*>(fGeometryProcessor.get()->fGLProc.ge
t()); | |
200 pathProc->setTransformData(primProc, index, proc.processor()->coordTransform
s(), | |
201 fGpu->glPathRendering(), fProgramID); | |
202 } | |
203 | |
204 void GrGLNvprProgram::onSetRenderTargetState(const GrPrimitiveProcessor& primPro
c, | |
205 const GrPipeline& pipeline) { | |
206 SkASSERT(!primProc.willUseGeoShader() && primProc.numAttribs() == 0); | |
207 const GrRenderTarget* rt = pipeline.getRenderTarget(); | |
208 SkISize size; | |
209 size.set(rt->width(), rt->height()); | |
210 const GrPathProcessor& pathProc = primProc.cast<GrPathProcessor>(); | |
211 fGpu->glPathRendering()->setProjectionMatrix(pathProc.viewMatrix(), | |
212 size, rt->origin()); | |
213 } | |
OLD | NEW |