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 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 GrEffectRef* DIEllipseEdgeEffect::TestCreate(SkMWCRandom* random, | 457 GrEffectRef* DIEllipseEdgeEffect::TestCreate(SkMWCRandom* random, |
458 GrContext* context, | 458 GrContext* context, |
459 const GrDrawTargetCaps&, | 459 const GrDrawTargetCaps&, |
460 GrTexture* textures[]) { | 460 GrTexture* textures[]) { |
461 return DIEllipseEdgeEffect::Create((Mode)(random->nextRangeU(0,2))); | 461 return DIEllipseEdgeEffect::Create((Mode)(random->nextRangeU(0,2))); |
462 } | 462 } |
463 | 463 |
464 /////////////////////////////////////////////////////////////////////////////// | 464 /////////////////////////////////////////////////////////////////////////////// |
465 | 465 |
466 void GrOvalRenderer::reset() { | 466 void GrOvalRenderer::reset() { |
467 GrSafeSetNull(fRRectIndexBuffer); | 467 SkSafeSetNull(fRRectIndexBuffer); |
468 } | 468 } |
469 | 469 |
470 bool GrOvalRenderer::drawOval(GrDrawTarget* target, const GrContext* context, bo
ol useAA, | 470 bool GrOvalRenderer::drawOval(GrDrawTarget* target, const GrContext* context, bo
ol useAA, |
471 const SkRect& oval, const SkStrokeRec& stroke) | 471 const SkRect& oval, const SkStrokeRec& stroke) |
472 { | 472 { |
473 if (!useAA) { | 473 if (!useAA) { |
474 return false; | 474 return false; |
475 } | 475 } |
476 | 476 |
477 const SkMatrix& vm = context->getMatrix(); | 477 const SkMatrix& vm = context->getMatrix(); |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1141 } | 1141 } |
1142 | 1142 |
1143 // drop out the middle quad if we're stroked | 1143 // drop out the middle quad if we're stroked |
1144 int indexCnt = isStroked ? GR_ARRAY_COUNT(gRRectIndices)-6 : GR_ARRAY_CO
UNT(gRRectIndices); | 1144 int indexCnt = isStroked ? GR_ARRAY_COUNT(gRRectIndices)-6 : GR_ARRAY_CO
UNT(gRRectIndices); |
1145 target->setIndexSourceToBuffer(indexBuffer); | 1145 target->setIndexSourceToBuffer(indexBuffer); |
1146 target->drawIndexed(kTriangles_GrPrimitiveType, 0, 0, 16, indexCnt, &bou
nds); | 1146 target->drawIndexed(kTriangles_GrPrimitiveType, 0, 0, 16, indexCnt, &bou
nds); |
1147 } | 1147 } |
1148 | 1148 |
1149 return true; | 1149 return true; |
1150 } | 1150 } |
OLD | NEW |