summaryrefslogtreecommitdiffstats
path: root/gfx/skia/skia/src/gpu/GrBatchTest.cpp
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /gfx/skia/skia/src/gpu/GrBatchTest.cpp
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'gfx/skia/skia/src/gpu/GrBatchTest.cpp')
-rw-r--r--gfx/skia/skia/src/gpu/GrBatchTest.cpp59
1 files changed, 59 insertions, 0 deletions
diff --git a/gfx/skia/skia/src/gpu/GrBatchTest.cpp b/gfx/skia/skia/src/gpu/GrBatchTest.cpp
new file mode 100644
index 000000000..fe320a268
--- /dev/null
+++ b/gfx/skia/skia/src/gpu/GrBatchTest.cpp
@@ -0,0 +1,59 @@
+/*
+ * 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"
+
+#ifdef GR_TEST_UTILS
+
+DRAW_BATCH_TEST_EXTERN(AAConvexPathBatch);
+DRAW_BATCH_TEST_EXTERN(AADistanceFieldPathBatch);
+DRAW_BATCH_TEST_EXTERN(AAFillRectBatch);
+DRAW_BATCH_TEST_EXTERN(AAFillRectBatchLocalMatrix);
+DRAW_BATCH_TEST_EXTERN(AAHairlineBatch);
+DRAW_BATCH_TEST_EXTERN(AAStrokeRectBatch);
+DRAW_BATCH_TEST_EXTERN(AnalyticRectBatch);
+DRAW_BATCH_TEST_EXTERN(DashBatch);
+DRAW_BATCH_TEST_EXTERN(DefaultPathBatch);
+DRAW_BATCH_TEST_EXTERN(CircleBatch);
+DRAW_BATCH_TEST_EXTERN(DIEllipseBatch);
+DRAW_BATCH_TEST_EXTERN(EllipseBatch);
+DRAW_BATCH_TEST_EXTERN(GrDrawAtlasBatch);
+DRAW_BATCH_TEST_EXTERN(NonAAStrokeRectBatch);
+DRAW_BATCH_TEST_EXTERN(RRectBatch);
+DRAW_BATCH_TEST_EXTERN(TesselatingPathBatch);
+DRAW_BATCH_TEST_EXTERN(TextBlobBatch);
+DRAW_BATCH_TEST_EXTERN(VerticesBatch);
+
+static BatchTestFunc gTestBatches[] = {
+ DRAW_BATCH_TEST_ENTRY(AAConvexPathBatch),
+ DRAW_BATCH_TEST_ENTRY(AADistanceFieldPathBatch),
+ DRAW_BATCH_TEST_ENTRY(AAFillRectBatch),
+ DRAW_BATCH_TEST_ENTRY(AAFillRectBatchLocalMatrix),
+ DRAW_BATCH_TEST_ENTRY(AAHairlineBatch),
+ DRAW_BATCH_TEST_ENTRY(AAStrokeRectBatch),
+ DRAW_BATCH_TEST_ENTRY(AnalyticRectBatch),
+ DRAW_BATCH_TEST_ENTRY(DashBatch),
+ DRAW_BATCH_TEST_ENTRY(DefaultPathBatch),
+ DRAW_BATCH_TEST_ENTRY(CircleBatch),
+ DRAW_BATCH_TEST_ENTRY(DIEllipseBatch),
+ DRAW_BATCH_TEST_ENTRY(EllipseBatch),
+ DRAW_BATCH_TEST_ENTRY(GrDrawAtlasBatch),
+ DRAW_BATCH_TEST_ENTRY(NonAAStrokeRectBatch),
+ DRAW_BATCH_TEST_ENTRY(RRectBatch),
+ DRAW_BATCH_TEST_ENTRY(TesselatingPathBatch),
+ DRAW_BATCH_TEST_ENTRY(TextBlobBatch),
+ DRAW_BATCH_TEST_ENTRY(VerticesBatch)
+};
+
+GrDrawBatch* GrRandomDrawBatch(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);
+}
+#endif