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

Unified Diff: src/gpu/GrTestUtils.cpp

Issue 1109153004: Initial CL to create GrBatchTest infrastructure (Closed) Base URL: https://skia.googlesource.com/skia.git@rand-batch0
Patch Set: adding stroke rect Created 5 years, 8 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/GrBatchTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrTestUtils.cpp
diff --git a/src/gpu/GrTestUtils.cpp b/src/gpu/GrTestUtils.cpp
index c132663d2020d1b45c2f27be6065b0faac4a32ae..f6305a55c83ce90fe7b802ab56fa9e3009dc75f2 100644
--- a/src/gpu/GrTestUtils.cpp
+++ b/src/gpu/GrTestUtils.cpp
@@ -26,4 +26,15 @@ const SkMatrix& TestMatrix(SkRandom* random) {
}
return gMatrices[random->nextULessThan(static_cast<uint32_t>(SK_ARRAY_COUNT(gMatrices)))];
}
+
+const SkRect& TestRect(SkRandom* random) {
+ static SkRect gRects[1];
+ static bool gOnce;
+ // Right now just a normal rect, we could test invalid / empty rects too
+ if (!gOnce) {
+ gRects[0] = SkRect::MakeWH(1.f, 1.f);
robertphillips 2015/04/29 13:23:01 gRects[1] = SkRect::MakeWH(1.0f, 256.0f); gRects[2
+ gOnce = true;
+ }
+ return gRects[random->nextULessThan(static_cast<uint32_t>(SK_ARRAY_COUNT(gRects)))];
+}
};
« no previous file with comments | « src/gpu/GrBatchTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698