aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/TestUtils.h
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-01-27 10:11:42 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-01-27 15:52:20 +0000
commit3500b77f7d08dbe4c17811733cc3e4dbab889f0a (patch)
treee9e7582c09ddd926d9486a1e5a0497e8cb0831b6 /tests/TestUtils.h
parent052fd5158f7f85e478a9f87c45fecaacf7d0f5f3 (diff)
Consolidate read/write-Pixels testing code - take 2
Change-Id: I0de058a9eec749a7086138ac2eb79732f06ce55e Reviewed-on: https://skia-review.googlesource.com/7650 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'tests/TestUtils.h')
-rw-r--r--tests/TestUtils.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/TestUtils.h b/tests/TestUtils.h
new file mode 100644
index 0000000000..7c3370ed7e
--- /dev/null
+++ b/tests/TestUtils.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2017 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "Test.h"
+
+#if SK_SUPPORT_GPU
+
+class GrSurfaceContext;
+class GrSurfaceProxy;
+
+// Ensure that reading back from 'srcContext' as RGBA 8888 matches 'expectedPixelValues
+void test_read_pixels(skiatest::Reporter* reporter, GrContext* context,
+ GrSurfaceContext* srcContext, uint32_t expectedPixelValues[],
+ const char* testName);
+
+// See if trying to write RGBA 8888 pixels to 'dstContext' matches matches the
+// expectation ('expectedToWork')
+void test_write_pixels(skiatest::Reporter* reporter, GrContext* context,
+ GrSurfaceContext* srcContext, bool expectedToWork, const char* testName);
+
+// Ensure that the pixels can be copied from 'proxy' to an RGBA 8888 destination (both
+// texture-backed and rendertarget-backed).
+void test_copy_from_surface(skiatest::Reporter* reporter, GrContext* context,
+ GrSurfaceProxy* proxy, uint32_t expectedPixelValues[],
+ bool onlyTestRTConfig, const char* testName);
+
+// Ensure that RGBA 8888 pixels can be copied into 'dstContext'
+void test_copy_to_surface(skiatest::Reporter* reporter, GrContext* context,
+ GrSurfaceContext* dstContext, const char* testName);
+#endif