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

Unified Diff: src/gpu/GrOvalRenderer.cpp

Issue 1129083005: AADistanceFieldPathRenderer unit tests (Closed) Base URL: https://skia.googlesource.com/skia.git@randbatch7
Patch Set: 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
Index: src/gpu/GrOvalRenderer.cpp
diff --git a/src/gpu/GrOvalRenderer.cpp b/src/gpu/GrOvalRenderer.cpp
index eb22ca9cb41d795c439aaea5232dfac4703faf7d..1db54984ecaa7c8341c1fc51ef9ff05aec7f0128 100644
--- a/src/gpu/GrOvalRenderer.cpp
+++ b/src/gpu/GrOvalRenderer.cpp
@@ -2091,22 +2091,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) {
@@ -2115,7 +2106,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) {
@@ -2124,14 +2115,15 @@ 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

Powered by Google App Engine
This is Rietveld 408576698