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

Unified Diff: include/gpu/GrTestUtils.h

Issue 1109153004: Initial CL to create GrBatchTest infrastructure (Closed) Base URL: https://skia.googlesource.com/skia.git@rand-batch0
Patch Set: windows warnings 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
Index: include/gpu/GrTestUtils.h
diff --git a/include/gpu/GrTestUtils.h b/include/gpu/GrTestUtils.h
index e6bfa7476f99e075d1f435958812f62d6e3c278c..88063c6f3866d163c786a2ff14c08c4decde096b 100644
--- a/include/gpu/GrTestUtils.h
+++ b/include/gpu/GrTestUtils.h
@@ -8,16 +8,22 @@
#ifndef GrTestUtils_DEFINED
#define GrTestUtils_DEFINED
+#include "SkTypes.h"
+
+#ifdef GR_TEST_UTILS
+
#include "GrColor.h"
#include "SkRandom.h"
class SkMatrix;
+struct SkRect;
namespace GrTest {
/**
* A helper for use in Test functions.
*/
const SkMatrix& TestMatrix(SkRandom*);
+const SkRect& TestRect(SkRandom*);
}
@@ -46,13 +52,14 @@ static inline GrColor GrRandomColor(SkRandom* random) {
random->nextULessThan(256),
0xFF);
break;
- case kRandom_ColorMode:
- uint8_t alpha = random->nextULessThan(256);
- color = GrColorPackRGBA(random->nextRangeU(0, alpha),
- random->nextRangeU(0, alpha),
- random->nextRangeU(0, alpha),
- alpha);
+ case kRandom_ColorMode: {
+ uint8_t alpha = random->nextULessThan(256);
+ color = GrColorPackRGBA(random->nextRangeU(0, alpha),
+ random->nextRangeU(0, alpha),
+ random->nextRangeU(0, alpha),
+ alpha);
break;
+ }
}
GrColorIsPMAssert(color);
return color;
@@ -82,3 +89,4 @@ static inline uint8_t GrRandomCoverage(SkRandom* random) {
}
#endif
+#endif
« no previous file with comments | « include/core/SkPostConfig.h ('k') | src/gpu/GrAARectRenderer.h » ('j') | src/gpu/GrTestUtils.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698