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 18 matching lines...) Expand all Loading... |
29 GrGLProgram::GrGLProgram(GrGLGpu* gpu, | 29 GrGLProgram::GrGLProgram(GrGLGpu* gpu, |
30 const GrProgramDesc& desc, | 30 const GrProgramDesc& desc, |
31 const BuiltinUniformHandles& builtinUniforms, | 31 const BuiltinUniformHandles& builtinUniforms, |
32 GrGLuint programID, | 32 GrGLuint programID, |
33 const UniformInfoArray& uniforms, | 33 const UniformInfoArray& uniforms, |
34 GrGLInstalledGeoProc* geometryProcessor, | 34 GrGLInstalledGeoProc* geometryProcessor, |
35 GrGLInstalledXferProc* xferProcessor, | 35 GrGLInstalledXferProc* xferProcessor, |
36 GrGLInstalledFragProcs* fragmentProcessors) | 36 GrGLInstalledFragProcs* fragmentProcessors) |
37 : fColor(GrColor_ILLEGAL) | 37 : fColor(GrColor_ILLEGAL) |
38 , fCoverage(0) | 38 , fCoverage(0) |
39 , fDstTextureUnit(-1) | 39 , fDstCopyTexUnit(-1) |
40 , fBuiltinUniformHandles(builtinUniforms) | 40 , fBuiltinUniformHandles(builtinUniforms) |
41 , fProgramID(programID) | 41 , fProgramID(programID) |
42 , fGeometryProcessor(geometryProcessor) | 42 , fGeometryProcessor(geometryProcessor) |
43 , fXferProcessor(xferProcessor) | 43 , fXferProcessor(xferProcessor) |
44 , fFragmentProcessors(SkRef(fragmentProcessors)) | 44 , fFragmentProcessors(SkRef(fragmentProcessors)) |
45 , fDesc(desc) | 45 , fDesc(desc) |
46 , fGpu(gpu) | 46 , fGpu(gpu) |
47 , fProgramDataManager(gpu, uniforms) { | 47 , fProgramDataManager(gpu, uniforms) { |
48 this->initSamplerUniforms(); | 48 this->initSamplerUniforms(); |
49 } | 49 } |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 void GrGLNvprProgram::onSetRenderTargetState(const GrPrimitiveProcessor& primPro
c, | 203 void GrGLNvprProgram::onSetRenderTargetState(const GrPrimitiveProcessor& primPro
c, |
204 const GrPipeline& pipeline) { | 204 const GrPipeline& pipeline) { |
205 SkASSERT(!primProc.willUseGeoShader() && primProc.numAttribs() == 0); | 205 SkASSERT(!primProc.willUseGeoShader() && primProc.numAttribs() == 0); |
206 const GrRenderTarget* rt = pipeline.getRenderTarget(); | 206 const GrRenderTarget* rt = pipeline.getRenderTarget(); |
207 SkISize size; | 207 SkISize size; |
208 size.set(rt->width(), rt->height()); | 208 size.set(rt->width(), rt->height()); |
209 const GrPathProcessor& pathProc = primProc.cast<GrPathProcessor>(); | 209 const GrPathProcessor& pathProc = primProc.cast<GrPathProcessor>(); |
210 fGpu->glPathRendering()->setProjectionMatrix(pathProc.viewMatrix(), | 210 fGpu->glPathRendering()->setProjectionMatrix(pathProc.viewMatrix(), |
211 size, rt->origin()); | 211 size, rt->origin()); |
212 } | 212 } |
OLD | NEW |