| 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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 } | 251 } |
| 252 | 252 |
| 253 fCurrentProgram.reset(fProgramCache->getProgram(desc, | 253 fCurrentProgram.reset(fProgramCache->getProgram(desc, |
| 254 colorStages.begin(), | 254 colorStages.begin(), |
| 255 coverageStages.begin()))
; | 255 coverageStages.begin()))
; |
| 256 if (NULL == fCurrentProgram.get()) { | 256 if (NULL == fCurrentProgram.get()) { |
| 257 SkDEBUGFAIL("Failed to create program!"); | 257 SkDEBUGFAIL("Failed to create program!"); |
| 258 return false; | 258 return false; |
| 259 } | 259 } |
| 260 | 260 |
| 261 SkASSERT((kDrawPath_DrawType != type && kDrawPaths_DrawType != type) | |
| 262 || !fCurrentProgram->hasVertexShader()); | |
| 263 | |
| 264 fCurrentProgram.get()->ref(); | 261 fCurrentProgram.get()->ref(); |
| 265 | 262 |
| 266 GrGLuint programID = fCurrentProgram->programID(); | 263 GrGLuint programID = fCurrentProgram->programID(); |
| 267 if (fHWProgramID != programID) { | 264 if (fHWProgramID != programID) { |
| 268 GL_CALL(UseProgram(programID)); | 265 GL_CALL(UseProgram(programID)); |
| 269 fHWProgramID = programID; | 266 fHWProgramID = programID; |
| 270 } | 267 } |
| 271 | 268 |
| 272 fCurrentProgram->overrideBlend(&srcCoeff, &dstCoeff); | 269 fCurrentProgram->overrideBlend(&srcCoeff, &dstCoeff); |
| 273 this->flushBlend(kDrawLines_DrawType == type, srcCoeff, dstCoeff); | 270 this->flushBlend(kDrawLines_DrawType == type, srcCoeff, dstCoeff); |
| 274 | 271 |
| 275 fCurrentProgram->setData(blendOpts, | 272 fCurrentProgram->setData(type, |
| 273 blendOpts, |
| 276 colorStages.begin(), | 274 colorStages.begin(), |
| 277 coverageStages.begin(), | 275 coverageStages.begin(), |
| 278 dstCopy, | 276 dstCopy, |
| 279 &fSharedGLProgramState); | 277 &fSharedGLProgramState); |
| 280 } | 278 } |
| 281 this->flushStencil(type); | 279 this->flushStencil(type); |
| 282 this->flushScissor(); | 280 this->flushScissor(); |
| 283 this->flushAAState(type); | 281 this->flushAAState(type); |
| 284 | 282 |
| 285 SkIRect* devRect = NULL; | 283 SkIRect* devRect = NULL; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 GrGLAttribTypeToLayout(attribType).fType, | 368 GrGLAttribTypeToLayout(attribType).fType, |
| 371 GrGLAttribTypeToLayout(attribType).fNormalized, | 369 GrGLAttribTypeToLayout(attribType).fNormalized, |
| 372 stride, | 370 stride, |
| 373 reinterpret_cast<GrGLvoid*>( | 371 reinterpret_cast<GrGLvoid*>( |
| 374 vertexOffsetInBytes + vertexAttrib->fOffset)); | 372 vertexOffsetInBytes + vertexAttrib->fOffset)); |
| 375 } | 373 } |
| 376 } | 374 } |
| 377 attribState->disableUnusedArrays(this, usedAttribArraysMask); | 375 attribState->disableUnusedArrays(this, usedAttribArraysMask); |
| 378 } | 376 } |
| 379 } | 377 } |
| OLD | NEW |