OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "GrOvalRenderer.h" | 8 #include "GrOvalRenderer.h" |
9 | 9 |
10 #include "GrEffect.h" | 10 #include "GrEffect.h" |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 | 345 |
346 static const char* Name() { return "DIEllipseEdge"; } | 346 static const char* Name() { return "DIEllipseEdge"; } |
347 | 347 |
348 inline Mode getMode() const { return fMode; } | 348 inline Mode getMode() const { return fMode; } |
349 | 349 |
350 class GLEffect : public GrGLEffect { | 350 class GLEffect : public GrGLEffect { |
351 public: | 351 public: |
352 GLEffect(const GrBackendEffectFactory& factory, const GrDrawEffect&) | 352 GLEffect(const GrBackendEffectFactory& factory, const GrDrawEffect&) |
353 : INHERITED (factory) {} | 353 : INHERITED (factory) {} |
354 | 354 |
| 355 virtual bool requiresVertexShader(const GrDrawEffect&) const SK_OVERRIDE
{ return true; } |
| 356 |
355 virtual void emitCode(GrGLShaderBuilder* builder, | 357 virtual void emitCode(GrGLShaderBuilder* builder, |
356 const GrDrawEffect& drawEffect, | 358 const GrDrawEffect& drawEffect, |
357 EffectKey key, | 359 EffectKey key, |
358 const char* outputColor, | 360 const char* outputColor, |
359 const char* inputColor, | 361 const char* inputColor, |
360 const TextureSamplerArray& samplers) SK_OVERRIDE { | 362 const TextureSamplerArray& samplers) SK_OVERRIDE { |
361 GrGLShaderBuilder::VertexBuilder* vertexBuilder = builder->getVertex
Builder(); | 363 GrGLShaderBuilder::VertexBuilder* vertexBuilder = builder->getVertex
Builder(); |
362 SkASSERT(NULL != vertexBuilder); | 364 SkASSERT(NULL != vertexBuilder); |
363 | 365 |
364 const DIEllipseEdgeEffect& ellipseEffect = drawEffect.castEffect<DIE
llipseEdgeEffect>(); | 366 const DIEllipseEdgeEffect& ellipseEffect = drawEffect.castEffect<DIE
llipseEdgeEffect>(); |
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1141 } | 1143 } |
1142 | 1144 |
1143 // drop out the middle quad if we're stroked | 1145 // drop out the middle quad if we're stroked |
1144 int indexCnt = isStroked ? GR_ARRAY_COUNT(gRRectIndices)-6 : GR_ARRAY_CO
UNT(gRRectIndices); | 1146 int indexCnt = isStroked ? GR_ARRAY_COUNT(gRRectIndices)-6 : GR_ARRAY_CO
UNT(gRRectIndices); |
1145 target->setIndexSourceToBuffer(indexBuffer); | 1147 target->setIndexSourceToBuffer(indexBuffer); |
1146 target->drawIndexed(kTriangles_GrPrimitiveType, 0, 0, 16, indexCnt, &bou
nds); | 1148 target->drawIndexed(kTriangles_GrPrimitiveType, 0, 0, 16, indexCnt, &bou
nds); |
1147 } | 1149 } |
1148 | 1150 |
1149 return true; | 1151 return true; |
1150 } | 1152 } |
OLD | NEW |