Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(223)

Unified Diff: src/gpu/GrOvalRenderer.cpp

Issue 1129083005: AADistanceFieldPathRenderer unit tests (Closed) Base URL: https://skia.googlesource.com/skia.git@randbatch7
Patch Set: tweaks Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrAADistanceFieldPathRenderer.cpp ('k') | src/gpu/GrTestUtils.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrOvalRenderer.cpp
diff --git a/src/gpu/GrOvalRenderer.cpp b/src/gpu/GrOvalRenderer.cpp
index 886159cdac402798adef9e823e36df79186e4eea..ebac42fcac8744c36f88d14ea5c05daf662bf68a 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
« no previous file with comments | « src/gpu/GrAADistanceFieldPathRenderer.cpp ('k') | src/gpu/GrTestUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698