Chromium Code Reviews| 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 171 case GrGLProgramDesc::kUniform_ColorInput: | 171 case GrGLProgramDesc::kUniform_ColorInput: |
| 172 if (fColor != color && fBuilderOutput.fUniformHandles.fColorUni. isValid()) { | 172 if (fColor != color && fBuilderOutput.fUniformHandles.fColorUni. isValid()) { |
| 173 // OpenGL ES doesn't support unsigned byte varieties of glUn iform | 173 // OpenGL ES doesn't support unsigned byte varieties of glUn iform |
| 174 GrGLfloat c[4]; | 174 GrGLfloat c[4]; |
| 175 GrColorToRGBAFloat(color, c); | 175 GrColorToRGBAFloat(color, c); |
| 176 fUniformManager->set4fv(fBuilderOutput.fUniformHandles.fColo rUni, 1, c); | 176 fUniformManager->set4fv(fBuilderOutput.fUniformHandles.fColo rUni, 1, c); |
| 177 fColor = color; | 177 fColor = color; |
| 178 } | 178 } |
| 179 sharedState->fConstAttribColorIndex = -1; | 179 sharedState->fConstAttribColorIndex = -1; |
| 180 break; | 180 break; |
| 181 case GrGLProgramDesc::kSolidWhite_ColorInput: | |
| 182 case GrGLProgramDesc::kTransBlack_ColorInput: | |
| 183 sharedState->fConstAttribColorIndex = -1; | |
| 184 break; | |
| 185 default: | 181 default: |
| 186 SkFAIL("Unknown color type."); | 182 SkFAIL("Unknown color type."); |
|
bsalomon
2014/07/11 14:29:52
Since the enums are still defined but now not expe
egdaniel
2014/07/11 15:01:25
done.
On 2014/07/11 14:29:52, bsalomon wrote:
| |
| 187 } | 183 } |
| 188 } else { | 184 } else { |
| 189 sharedState->fConstAttribColorIndex = -1; | 185 sharedState->fConstAttribColorIndex = -1; |
| 190 } | 186 } |
| 191 } | 187 } |
| 192 | 188 |
| 193 void GrGLProgram::setCoverage(const GrDrawState& drawState, | 189 void GrGLProgram::setCoverage(const GrDrawState& drawState, |
| 194 GrColor coverage, | 190 GrColor coverage, |
| 195 SharedGLState* sharedState) { | 191 SharedGLState* sharedState) { |
| 196 const GrGLProgramDesc::KeyHeader& header = fDesc.getHeader(); | 192 const GrGLProgramDesc::KeyHeader& header = fDesc.getHeader(); |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 211 if (fCoverage != coverage) { | 207 if (fCoverage != coverage) { |
| 212 // OpenGL ES doesn't support unsigned byte varieties of glUn iform | 208 // OpenGL ES doesn't support unsigned byte varieties of glUn iform |
| 213 GrGLfloat c[4]; | 209 GrGLfloat c[4]; |
| 214 GrColorToRGBAFloat(coverage, c); | 210 GrColorToRGBAFloat(coverage, c); |
| 215 fUniformManager->set4fv(fBuilderOutput.fUniformHandles.fCove rageUni, 1, c); | 211 fUniformManager->set4fv(fBuilderOutput.fUniformHandles.fCove rageUni, 1, c); |
| 216 fCoverage = coverage; | 212 fCoverage = coverage; |
| 217 } | 213 } |
| 218 sharedState->fConstAttribCoverageIndex = -1; | 214 sharedState->fConstAttribCoverageIndex = -1; |
| 219 break; | 215 break; |
| 220 case GrGLProgramDesc::kSolidWhite_ColorInput: | 216 case GrGLProgramDesc::kSolidWhite_ColorInput: |
| 221 case GrGLProgramDesc::kTransBlack_ColorInput: | |
| 222 sharedState->fConstAttribCoverageIndex = -1; | 217 sharedState->fConstAttribCoverageIndex = -1; |
| 223 break; | 218 break; |
| 224 default: | 219 default: |
| 225 SkFAIL("Unknown coverage type."); | 220 SkFAIL("Unknown coverage type."); |
|
bsalomon
2014/07/11 14:29:53
ditto
egdaniel
2014/07/11 15:01:25
done
On 2014/07/11 14:29:53, bsalomon wrote:
| |
| 226 } | 221 } |
| 227 } else { | 222 } else { |
| 228 sharedState->fConstAttribCoverageIndex = -1; | 223 sharedState->fConstAttribCoverageIndex = -1; |
| 229 } | 224 } |
| 230 } | 225 } |
| 231 | 226 |
| 232 void GrGLProgram::setMatrixAndRenderTargetHeight(const GrDrawState& drawState) { | 227 void GrGLProgram::setMatrixAndRenderTargetHeight(const GrDrawState& drawState) { |
| 233 const GrRenderTarget* rt = drawState.getRenderTarget(); | 228 const GrRenderTarget* rt = drawState.getRenderTarget(); |
| 234 SkISize size; | 229 SkISize size; |
| 235 size.set(rt->width(), rt->height()); | 230 size.set(rt->width(), rt->height()); |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 256 | 251 |
| 257 GrGLfloat viewMatrix[3 * 3]; | 252 GrGLfloat viewMatrix[3 * 3]; |
| 258 fMatrixState.getGLMatrix<3>(viewMatrix); | 253 fMatrixState.getGLMatrix<3>(viewMatrix); |
| 259 fUniformManager->setMatrix3f(fBuilderOutput.fUniformHandles.fViewMatrixU ni, viewMatrix); | 254 fUniformManager->setMatrix3f(fBuilderOutput.fUniformHandles.fViewMatrixU ni, viewMatrix); |
| 260 | 255 |
| 261 GrGLfloat rtAdjustmentVec[4]; | 256 GrGLfloat rtAdjustmentVec[4]; |
| 262 fMatrixState.getRTAdjustmentVec(rtAdjustmentVec); | 257 fMatrixState.getRTAdjustmentVec(rtAdjustmentVec); |
| 263 fUniformManager->set4fv(fBuilderOutput.fUniformHandles.fRTAdjustmentUni, 1, rtAdjustmentVec); | 258 fUniformManager->set4fv(fBuilderOutput.fUniformHandles.fRTAdjustmentUni, 1, rtAdjustmentVec); |
| 264 } | 259 } |
| 265 } | 260 } |
| OLD | NEW |