Chromium Code Reviews| 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)))]; |
| +} |
| }; |