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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 GrBlendCoeff srcCoeff; | 227 GrBlendCoeff srcCoeff; |
228 GrBlendCoeff dstCoeff; | 228 GrBlendCoeff dstCoeff; |
229 GrDrawState::BlendOptFlags blendOpts = drawState.getBlendOpts(false, &sr
cCoeff, &dstCoeff); | 229 GrDrawState::BlendOptFlags blendOpts = drawState.getBlendOpts(false, &sr
cCoeff, &dstCoeff); |
230 if (GrDrawState::kSkipDraw_BlendOptFlag & blendOpts) { | 230 if (GrDrawState::kSkipDraw_BlendOptFlag & blendOpts) { |
231 return false; | 231 return false; |
232 } | 232 } |
233 | 233 |
234 SkSTArray<8, const GrEffectStage*, true> colorStages; | 234 SkSTArray<8, const GrEffectStage*, true> colorStages; |
235 SkSTArray<8, const GrEffectStage*, true> coverageStages; | 235 SkSTArray<8, const GrEffectStage*, true> coverageStages; |
236 GrGLProgramDesc desc; | 236 GrGLProgramDesc desc; |
237 GrGLProgramDesc::Build(this->getDrawState(), | 237 if (!GrGLProgramDesc::Build(this->getDrawState(), |
238 type, | 238 type, |
239 blendOpts, | 239 blendOpts, |
240 srcCoeff, | 240 srcCoeff, |
241 dstCoeff, | 241 dstCoeff, |
242 this, | 242 this, |
243 dstCopy, | 243 dstCopy, |
244 &colorStages, | 244 &colorStages, |
245 &coverageStages, | 245 &coverageStages, |
246 &desc); | 246 &desc)) { |
| 247 SkDEBUGFAIL("Failed to generate GL program descriptor"); |
| 248 return false; |
| 249 } |
247 | 250 |
248 fCurrentProgram.reset(fProgramCache->getProgram(desc, | 251 fCurrentProgram.reset(fProgramCache->getProgram(desc, |
249 colorStages.begin(), | 252 colorStages.begin(), |
250 coverageStages.begin()))
; | 253 coverageStages.begin()))
; |
251 if (NULL == fCurrentProgram.get()) { | 254 if (NULL == fCurrentProgram.get()) { |
252 SkDEBUGFAIL("Failed to create program!"); | 255 SkDEBUGFAIL("Failed to create program!"); |
253 return false; | 256 return false; |
254 } | 257 } |
255 | 258 |
256 SkASSERT((kDrawPath_DrawType != type && kDrawPaths_DrawType != type) | 259 SkASSERT((kDrawPath_DrawType != type && kDrawPaths_DrawType != type) |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 GrGLAttribTypeToLayout(attribType).fCount, | 364 GrGLAttribTypeToLayout(attribType).fCount, |
362 GrGLAttribTypeToLayout(attribType).fType, | 365 GrGLAttribTypeToLayout(attribType).fType, |
363 GrGLAttribTypeToLayout(attribType).fNormalized, | 366 GrGLAttribTypeToLayout(attribType).fNormalized, |
364 stride, | 367 stride, |
365 reinterpret_cast<GrGLvoid*>( | 368 reinterpret_cast<GrGLvoid*>( |
366 vertexOffsetInBytes + vertexAttrib->fOffset)); | 369 vertexOffsetInBytes + vertexAttrib->fOffset)); |
367 } | 370 } |
368 attribState->disableUnusedArrays(this, usedAttribArraysMask); | 371 attribState->disableUnusedArrays(this, usedAttribArraysMask); |
369 } | 372 } |
370 } | 373 } |
OLD | NEW |