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 "gl/builders/GrGLProgramBuilder.h" | 10 #include "gl/builders/GrGLProgramBuilder.h" |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 GrContext* context, | 453 GrContext* context, |
454 const GrDrawTargetCaps&, | 454 const GrDrawTargetCaps&, |
455 GrTexture* textures[]) { | 455 GrTexture* textures[]) { |
456 return DIEllipseEdgeEffect::Create((Mode)(random->nextRangeU(0,2))); | 456 return DIEllipseEdgeEffect::Create((Mode)(random->nextRangeU(0,2))); |
457 } | 457 } |
458 | 458 |
459 /////////////////////////////////////////////////////////////////////////////// | 459 /////////////////////////////////////////////////////////////////////////////// |
460 | 460 |
461 void GrOvalRenderer::reset() { | 461 void GrOvalRenderer::reset() { |
462 SkSafeSetNull(fRRectIndexBuffer); | 462 SkSafeSetNull(fRRectIndexBuffer); |
| 463 SkSafeSetNull(fStrokeRRectIndexBuffer); |
463 } | 464 } |
464 | 465 |
465 bool GrOvalRenderer::drawOval(GrDrawTarget* target, const GrContext* context, bo
ol useAA, | 466 bool GrOvalRenderer::drawOval(GrDrawTarget* target, const GrContext* context, bo
ol useAA, |
466 const SkRect& oval, const SkStrokeRec& stroke) | 467 const SkRect& oval, const SkStrokeRec& stroke) |
467 { | 468 { |
468 bool useCoverageAA = useAA && | 469 bool useCoverageAA = useAA && |
469 !target->getDrawState().getRenderTarget()->isMultisampled() && | 470 !target->getDrawState().getRenderTarget()->isMultisampled() && |
470 !target->shouldDisableCoverageAAForBlend(); | 471 !target->shouldDisableCoverageAAForBlend(); |
471 | 472 |
472 if (!useCoverageAA) { | 473 if (!useCoverageAA) { |
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1233 // drop out the middle quad if we're stroked | 1234 // drop out the middle quad if we're stroked |
1234 int indexCnt = isStrokeOnly ? SK_ARRAY_COUNT(gRRectIndices) - 6 : | 1235 int indexCnt = isStrokeOnly ? SK_ARRAY_COUNT(gRRectIndices) - 6 : |
1235 SK_ARRAY_COUNT(gRRectIndices); | 1236 SK_ARRAY_COUNT(gRRectIndices); |
1236 target->setIndexSourceToBuffer(indexBuffer); | 1237 target->setIndexSourceToBuffer(indexBuffer); |
1237 target->drawIndexedInstances(kTriangles_GrPrimitiveType, 1, 16, indexCnt
, &bounds); | 1238 target->drawIndexedInstances(kTriangles_GrPrimitiveType, 1, 16, indexCnt
, &bounds); |
1238 } | 1239 } |
1239 | 1240 |
1240 target->resetIndexSource(); | 1241 target->resetIndexSource(); |
1241 return true; | 1242 return true; |
1242 } | 1243 } |
OLD | NEW |