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

Unified Diff: src/gpu/GrBatchTest.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
Index: src/gpu/GrBatchTest.cpp
diff --git a/src/gpu/GrBatchTest.cpp b/src/gpu/GrBatchTest.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..9b925ef0e035d433327a10e73d2cba7d5e6ee03b
--- /dev/null
+++ b/src/gpu/GrBatchTest.cpp
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "GrBatchTest.h"
+#include "SkRandom.h"
+#include "SkTypes.h"
+
+BATCH_TEST_EXTERN(AAFillRectBatch);
+BATCH_TEST_EXTERN(AAStrokeRectBatch);
+
+static BatchTestFunc gTestBatches[] = {
+ BATCH_TEST_ENTRY(AAFillRectBatch),
+ BATCH_TEST_ENTRY(AAStrokeRectBatch),
+};
+
+GrBatch* GrRandomBatch(SkRandom* random, GrContext* context) {
+ uint32_t index = random->nextULessThan(static_cast<uint32_t>(SK_ARRAY_COUNT(gTestBatches)));
+ BatchTestFunc func = gTestBatches[index];
+ return (*func)(random, context);
+}
« no previous file with comments | « src/gpu/GrBatchTest.h ('k') | src/gpu/GrTestUtils.cpp » ('j') | src/gpu/GrTestUtils.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698