| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "GrGLFragmentOnlyProgramBuilder.h" | 8 #include "GrGLFragmentOnlyProgramBuilder.h" |
| 9 #include "../GrGpuGL.h" | 9 #include "../GrGpuGL.h" |
| 10 | 10 |
| 11 GrGLFragmentOnlyProgramBuilder::GrGLFragmentOnlyProgramBuilder(GrGpuGL* gpu, | 11 GrGLFragmentOnlyProgramBuilder::GrGLFragmentOnlyProgramBuilder(GrGpuGL* gpu, |
| 12 const GrGLProgram
Desc& desc) | 12 const GrGLProgram
Desc& desc) |
| 13 : INHERITED(gpu, desc) { | 13 : INHERITED(gpu, desc) { |
| 14 SkASSERT(!desc.getHeader().fRequiresVertexShader); | 14 SkASSERT(desc.getHeader().fDoPathRendering); |
| 15 SkASSERT(gpu->glCaps().pathRenderingSupport()); | 15 SkASSERT(gpu->glCaps().pathRenderingSupport()); |
| 16 SkASSERT(GrGLProgramDesc::kAttribute_ColorInput != desc.getHeader().fColorIn
put); | 16 SkASSERT(GrGLProgramDesc::kAttribute_ColorInput != desc.getHeader().fColorIn
put); |
| 17 SkASSERT(GrGLProgramDesc::kAttribute_ColorInput != desc.getHeader().fCoverag
eInput); | 17 SkASSERT(GrGLProgramDesc::kAttribute_ColorInput != desc.getHeader().fCoverag
eInput); |
| 18 } | 18 } |
| 19 | 19 |
| 20 int GrGLFragmentOnlyProgramBuilder::addTexCoordSets(int count) { | 20 int GrGLFragmentOnlyProgramBuilder::addTexCoordSets(int count) { |
| 21 int firstFreeCoordSet = fTexCoordSetCnt; | 21 int firstFreeCoordSet = fTexCoordSetCnt; |
| 22 fTexCoordSetCnt += count; | 22 fTexCoordSetCnt += count; |
| 23 SkASSERT(gpu()->glCaps().maxFixedFunctionTextureCoords() >= fTexCoordSetCnt)
; | 23 SkASSERT(gpu()->glCaps().maxFixedFunctionTextureCoords() >= fTexCoordSetCnt)
; |
| 24 return firstFreeCoordSet; | 24 return firstFreeCoordSet; |
| 25 } | 25 } |
| 26 | 26 |
| 27 GrGLProgramEffects* GrGLFragmentOnlyProgramBuilder::createAndEmitEffects( | 27 GrGLProgramEffects* GrGLFragmentOnlyProgramBuilder::createAndEmitEffects( |
| 28 const GrEffectStage* effectStages[], int effectCnt, | 28 const GrEffectStage* effectStages[], int effectCnt, |
| 29 const GrGLProgramDesc::EffectKeyProvider& keyProvider, GrGLSLExpr4* inOu
tFSColor) { | 29 const GrGLProgramDesc::EffectKeyProvider& keyProvider, GrGLSLExpr4* inOu
tFSColor) { |
| 30 | 30 |
| 31 GrGLPathTexGenProgramEffectsBuilder pathTexGenEffectsBuilder(this, | 31 GrGLPathTexGenProgramEffectsBuilder pathTexGenEffectsBuilder(this, |
| 32 effectCnt); | 32 effectCnt); |
| 33 this->INHERITED::createAndEmitEffects(&pathTexGenEffectsBuilder, | 33 this->INHERITED::createAndEmitEffects(&pathTexGenEffectsBuilder, |
| 34 effectStages, | 34 effectStages, |
| 35 effectCnt, | 35 effectCnt, |
| 36 keyProvider, | 36 keyProvider, |
| 37 inOutFSColor); | 37 inOutFSColor); |
| 38 return pathTexGenEffectsBuilder.finish(); | 38 return pathTexGenEffectsBuilder.finish(); |
| 39 } | 39 } |
| OLD | NEW |