diff options
author | 2015-05-11 07:21:37 -0700 | |
---|---|---|
committer | 2015-05-11 07:21:37 -0700 | |
commit | 21279c7ada1e47e8bfc6375f67768c8eedffb680 (patch) | |
tree | 4b92012a02633ae7e1bbdb3ef506762ec7125b4d /src/gpu/GrOvalRenderer.cpp | |
parent | 624637cc8ec22c000409704d0b403ac1b81ad4b0 (diff) |
AADistanceFieldPathRenderer unit tests
TBR=bsalomon@google.com
BUG=skia:
Review URL: https://codereview.chromium.org/1129083005
Diffstat (limited to 'src/gpu/GrOvalRenderer.cpp')
-rw-r--r-- | src/gpu/GrOvalRenderer.cpp | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/gpu/GrOvalRenderer.cpp b/src/gpu/GrOvalRenderer.cpp index 886159cdac..ebac42fcac 100644 --- a/src/gpu/GrOvalRenderer.cpp +++ b/src/gpu/GrOvalRenderer.cpp @@ -2090,22 +2090,13 @@ bool GrOvalRenderer::drawRRect(GrDrawTarget* target, #ifdef GR_TEST_UTILS -static SkStrokeRec random_strokerec(SkRandom* random) { - SkStrokeRec::InitStyle style = - SkStrokeRec::InitStyle(random->nextULessThan(SkStrokeRec::kFill_InitStyle + 1)); - SkStrokeRec rec(style); - bool strokeAndFill = random->nextBool(); - SkScalar strokeWidth = random->nextBool() ? 0.f : 1.f; - rec.setStrokeStyle(strokeWidth, strokeAndFill); - return rec; -} - BATCH_TEST_DEFINE(CircleBatch) { SkMatrix viewMatrix = GrTest::TestMatrix(random); GrColor color = GrRandomColor(random); bool useCoverageAA = random->nextBool(); SkRect circle = GrTest::TestRect(random); - return create_circle_batch(color, viewMatrix, useCoverageAA, circle, random_strokerec(random)); + return create_circle_batch(color, viewMatrix, useCoverageAA, circle, + GrTest::TestStrokeRec(random)); } BATCH_TEST_DEFINE(EllipseBatch) { @@ -2114,7 +2105,7 @@ BATCH_TEST_DEFINE(EllipseBatch) { bool useCoverageAA = random->nextBool(); SkRect ellipse = GrTest::TestRect(random); return create_ellipse_batch(color, viewMatrix, useCoverageAA, ellipse, - random_strokerec(random)); + GrTest::TestStrokeRec(random)); } BATCH_TEST_DEFINE(DIEllipseBatch) { @@ -2123,14 +2114,14 @@ BATCH_TEST_DEFINE(DIEllipseBatch) { bool useCoverageAA = random->nextBool(); SkRect ellipse = GrTest::TestRect(random); return create_diellipse_batch(color, viewMatrix, useCoverageAA, ellipse, - random_strokerec(random)); + GrTest::TestStrokeRec(random)); } BATCH_TEST_DEFINE(RRectBatch) { SkMatrix viewMatrix = GrTest::TestMatrixRectStaysRect(random); GrColor color = GrRandomColor(random); const SkRRect& rrect = GrTest::TestRRectSimple(random); - return create_rrect_batch(color, viewMatrix, rrect, random_strokerec(random)); + return create_rrect_batch(color, viewMatrix, rrect, GrTest::TestStrokeRec(random)); } #endif |