aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrDrawOpTest.h
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2016-12-20 15:34:05 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-12-20 21:10:56 +0000
commit5ec9def2dd7bba572398ff2aa9361fbbb3b478ed (patch)
tree8e6105038fca868682ddf3a8306dce11b2e075ae /src/gpu/GrDrawOpTest.h
parent8c5bad35f5d98040f2db2ffd3ba9a924c7436784 (diff)
Rename files, macros, types, and functions related to GrDrawOp testing.
Make the test factories use sk_sp. Change-Id: Idba630b84deb2848f2203a80fd72e1efa5fc6acf Reviewed-on: https://skia-review.googlesource.com/6342 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/GrDrawOpTest.h')
-rw-r--r--src/gpu/GrDrawOpTest.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/gpu/GrDrawOpTest.h b/src/gpu/GrDrawOpTest.h
new file mode 100644
index 0000000000..0d88a40bf1
--- /dev/null
+++ b/src/gpu/GrDrawOpTest.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef GrDrawOpTest_DEFINED
+#define GrDrawOpTest_DEFINED
+
+#include "GrTestUtils.h"
+#include "SkRefCnt.h"
+
+#ifdef GR_TEST_UTILS
+
+class GrDrawOp;
+class GrContext;
+class SkRandom;
+
+/** This function returns a randomly configured GrDrawOp for testing purposes. */
+sk_sp<GrDrawOp> GrRandomDrawOp(SkRandom*, GrContext*);
+
+/** GrDrawOp subclasses should define test factory functions using this macro. */
+#define DRAW_OP_TEST_DEFINE(Op) sk_sp<GrDrawOp> Op##__Test(SkRandom* random, GrContext* context)
+
+/** This macro may be used if the test factory function must be made a friend of a class. */
+#define DRAW_OP_TEST_FRIEND(Op) \
+ friend sk_sp<GrDrawOp> Op##__Test(SkRandom* random, GrContext* context);
+
+#endif
+#endif