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 "GrGpuGL.h" | 8 #include "GrGpuGL.h" |
9 | 9 |
10 #include "GrEffect.h" | 10 #include "GrEffect.h" |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 &desc); | 244 &desc); |
245 | 245 |
246 fCurrentProgram.reset(fProgramCache->getProgram(desc, | 246 fCurrentProgram.reset(fProgramCache->getProgram(desc, |
247 colorStages.begin(), | 247 colorStages.begin(), |
248 coverageStages.begin()))
; | 248 coverageStages.begin()))
; |
249 if (NULL == fCurrentProgram.get()) { | 249 if (NULL == fCurrentProgram.get()) { |
250 SkDEBUGFAIL("Failed to create program!"); | 250 SkDEBUGFAIL("Failed to create program!"); |
251 return false; | 251 return false; |
252 } | 252 } |
253 | 253 |
254 SkASSERT(kDrawPath_DrawType != type || !fCurrentProgram->hasVertexShader
()); | 254 SkASSERT((kDrawPath_DrawType != type && kDrawPaths_DrawType != type) |
| 255 || !fCurrentProgram->hasVertexShader()); |
255 | 256 |
256 fCurrentProgram.get()->ref(); | 257 fCurrentProgram.get()->ref(); |
257 | 258 |
258 GrGLuint programID = fCurrentProgram->programID(); | 259 GrGLuint programID = fCurrentProgram->programID(); |
259 if (fHWProgramID != programID) { | 260 if (fHWProgramID != programID) { |
260 GL_CALL(UseProgram(programID)); | 261 GL_CALL(UseProgram(programID)); |
261 fHWProgramID = programID; | 262 fHWProgramID = programID; |
262 } | 263 } |
263 | 264 |
264 fCurrentProgram->overrideBlend(&srcCoeff, &dstCoeff); | 265 fCurrentProgram->overrideBlend(&srcCoeff, &dstCoeff); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 GrGLAttribTypeToLayout(attribType).fCount, | 379 GrGLAttribTypeToLayout(attribType).fCount, |
379 GrGLAttribTypeToLayout(attribType).fType, | 380 GrGLAttribTypeToLayout(attribType).fType, |
380 GrGLAttribTypeToLayout(attribType).fNormalized, | 381 GrGLAttribTypeToLayout(attribType).fNormalized, |
381 stride, | 382 stride, |
382 reinterpret_cast<GrGLvoid*>( | 383 reinterpret_cast<GrGLvoid*>( |
383 vertexOffsetInBytes + vertexAttrib->fOffset)); | 384 vertexOffsetInBytes + vertexAttrib->fOffset)); |
384 } | 385 } |
385 attribState->disableUnusedArrays(this, usedAttribArraysMask); | 386 attribState->disableUnusedArrays(this, usedAttribArraysMask); |
386 } | 387 } |
387 } | 388 } |
OLD | NEW |