| 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 #include "GrGLProgram.h" | 8 #include "GrGLProgram.h" |
| 8 | 9 |
| 9 #include "builders/GrGLFragmentOnlyProgramBuilder.h" | 10 #include "builders/GrGLFragmentOnlyProgramBuilder.h" |
| 10 #include "builders/GrGLFullProgramBuilder.h" | 11 #include "builders/GrGLFullProgramBuilder.h" |
| 11 #include "GrAllocator.h" | 12 #include "GrAllocator.h" |
| 12 #include "GrEffect.h" | 13 #include "GrEffect.h" |
| 13 #include "GrCoordTransform.h" | 14 #include "GrCoordTransform.h" |
| 14 #include "GrGLEffect.h" | 15 #include "GrGLEffect.h" |
| 15 #include "GrGpuGL.h" | 16 #include "GrGpuGL.h" |
| 16 #include "GrGLPathRendering.h" | 17 #include "GrGLPathRendering.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 SkASSERT(!fBuiltinUniformHandles.fDstCopySamplerUni.isValid()); | 141 SkASSERT(!fBuiltinUniformHandles.fDstCopySamplerUni.isValid()); |
| 141 } | 142 } |
| 142 } else { | 143 } else { |
| 143 SkASSERT(!fBuiltinUniformHandles.fDstCopyTopLeftUni.isValid()); | 144 SkASSERT(!fBuiltinUniformHandles.fDstCopyTopLeftUni.isValid()); |
| 144 SkASSERT(!fBuiltinUniformHandles.fDstCopyScaleUni.isValid()); | 145 SkASSERT(!fBuiltinUniformHandles.fDstCopyScaleUni.isValid()); |
| 145 SkASSERT(!fBuiltinUniformHandles.fDstCopySamplerUni.isValid()); | 146 SkASSERT(!fBuiltinUniformHandles.fDstCopySamplerUni.isValid()); |
| 146 } | 147 } |
| 147 | 148 |
| 148 if (fGeometryProcessor.get()) { | 149 if (fGeometryProcessor.get()) { |
| 149 SkASSERT(geometryProcessor); | 150 SkASSERT(geometryProcessor); |
| 150 fGeometryProcessor->setData(fGpu, drawType,fProgramDataManager, geometry
Processor); | 151 fGeometryProcessor->setData(fGpu, drawType, fProgramDataManager, &geomet
ryProcessor); |
| 151 } | 152 } |
| 152 fColorEffects->setData(fGpu, drawType,fProgramDataManager, colorStages); | 153 fColorEffects->setData(fGpu, drawType, fProgramDataManager, colorStages); |
| 153 fCoverageEffects->setData(fGpu, drawType,fProgramDataManager, coverageStages
); | 154 fCoverageEffects->setData(fGpu, drawType, fProgramDataManager, coverageStage
s); |
| 154 | 155 |
| 155 // PathTexGen state applies to the the fixed function vertex shader. For | 156 // PathTexGen state applies to the the fixed function vertex shader. For |
| 156 // custom shaders, it's ignored, so we don't need to change the texgen | 157 // custom shaders, it's ignored, so we don't need to change the texgen |
| 157 // settings in that case. | 158 // settings in that case. |
| 158 if (!fHasVertexShader) { | 159 if (!fHasVertexShader) { |
| 159 fGpu->glPathRendering()->flushPathTexGenSettings(fTexCoordSetCnt); | 160 fGpu->glPathRendering()->flushPathTexGenSettings(fTexCoordSetCnt); |
| 160 } | 161 } |
| 161 } | 162 } |
| 162 | 163 |
| 163 void GrGLProgram::setColor(const GrOptDrawState& optState, | 164 void GrGLProgram::setColor(const GrOptDrawState& optState, |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 | 264 |
| 264 GrGLfloat viewMatrix[3 * 3]; | 265 GrGLfloat viewMatrix[3 * 3]; |
| 265 fMatrixState.getGLMatrix<3>(viewMatrix); | 266 fMatrixState.getGLMatrix<3>(viewMatrix); |
| 266 fProgramDataManager.setMatrix3f(fBuiltinUniformHandles.fViewMatrixUni, v
iewMatrix); | 267 fProgramDataManager.setMatrix3f(fBuiltinUniformHandles.fViewMatrixUni, v
iewMatrix); |
| 267 | 268 |
| 268 GrGLfloat rtAdjustmentVec[4]; | 269 GrGLfloat rtAdjustmentVec[4]; |
| 269 fMatrixState.getRTAdjustmentVec(rtAdjustmentVec); | 270 fMatrixState.getRTAdjustmentVec(rtAdjustmentVec); |
| 270 fProgramDataManager.set4fv(fBuiltinUniformHandles.fRTAdjustmentUni, 1, r
tAdjustmentVec); | 271 fProgramDataManager.set4fv(fBuiltinUniformHandles.fRTAdjustmentUni, 1, r
tAdjustmentVec); |
| 271 } | 272 } |
| 272 } | 273 } |
| OLD | NEW |