| 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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 &coverageStages, | 245 &coverageStages, |
| 246 &desc); | 246 &desc); |
| 247 | 247 |
| 248 fCurrentProgram.reset(fProgramCache->getProgram(desc, | 248 fCurrentProgram.reset(fProgramCache->getProgram(desc, |
| 249 colorStages.begin(), | 249 colorStages.begin(), |
| 250 coverageStages.begin()))
; | 250 coverageStages.begin()))
; |
| 251 if (NULL == fCurrentProgram.get()) { | 251 if (NULL == fCurrentProgram.get()) { |
| 252 SkDEBUGFAIL("Failed to create program!"); | 252 SkDEBUGFAIL("Failed to create program!"); |
| 253 return false; | 253 return false; |
| 254 } | 254 } |
| 255 |
| 256 SkASSERT(kFillPath_DrawType != type || !fCurrentProgram->hasVertexShader
()); |
| 257 |
| 255 fCurrentProgram.get()->ref(); | 258 fCurrentProgram.get()->ref(); |
| 256 | 259 |
| 257 GrGLuint programID = fCurrentProgram->programID(); | 260 GrGLuint programID = fCurrentProgram->programID(); |
| 258 if (fHWProgramID != programID) { | 261 if (fHWProgramID != programID) { |
| 259 GL_CALL(UseProgram(programID)); | 262 GL_CALL(UseProgram(programID)); |
| 260 fHWProgramID = programID; | 263 fHWProgramID = programID; |
| 261 } | 264 } |
| 262 | 265 |
| 263 fCurrentProgram->overrideBlend(&srcCoeff, &dstCoeff); | 266 fCurrentProgram->overrideBlend(&srcCoeff, &dstCoeff); |
| 264 this->flushBlend(kDrawLines_DrawType == type, srcCoeff, dstCoeff); | 267 this->flushBlend(kDrawLines_DrawType == type, srcCoeff, dstCoeff); |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 GrGLAttribTypeToLayout(attribType).fType, | 374 GrGLAttribTypeToLayout(attribType).fType, |
| 372 GrGLAttribTypeToLayout(attribType).fNormalized, | 375 GrGLAttribTypeToLayout(attribType).fNormalized, |
| 373 stride, | 376 stride, |
| 374 reinterpret_cast<GrGLvoid*>( | 377 reinterpret_cast<GrGLvoid*>( |
| 375 vertexOffsetInBytes + vertexAttrib->fOffset)); | 378 vertexOffsetInBytes + vertexAttrib->fOffset)); |
| 376 } | 379 } |
| 377 | 380 |
| 378 attribState->disableUnusedArrays(this, usedAttribArraysMask, false); | 381 attribState->disableUnusedArrays(this, usedAttribArraysMask, false); |
| 379 } | 382 } |
| 380 } | 383 } |
| OLD | NEW |