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