Robert Phillips | 3500b77 | 2017-01-27 10:11:42 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2017 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #include "Test.h" |
| 9 | |
Robert Phillips | 3500b77 | 2017-01-27 10:11:42 -0500 | [diff] [blame] | 10 | class GrSurfaceContext; |
| 11 | class GrSurfaceProxy; |
| 12 | |
| 13 | // Ensure that reading back from 'srcContext' as RGBA 8888 matches 'expectedPixelValues |
Robert Phillips | 26c90e0 | 2017-03-14 14:39:29 -0400 | [diff] [blame] | 14 | void test_read_pixels(skiatest::Reporter*, |
Robert Phillips | 3500b77 | 2017-01-27 10:11:42 -0500 | [diff] [blame] | 15 | GrSurfaceContext* srcContext, uint32_t expectedPixelValues[], |
| 16 | const char* testName); |
| 17 | |
| 18 | // See if trying to write RGBA 8888 pixels to 'dstContext' matches matches the |
| 19 | // expectation ('expectedToWork') |
Robert Phillips | 26c90e0 | 2017-03-14 14:39:29 -0400 | [diff] [blame] | 20 | void test_write_pixels(skiatest::Reporter*, |
Robert Phillips | 3500b77 | 2017-01-27 10:11:42 -0500 | [diff] [blame] | 21 | GrSurfaceContext* srcContext, bool expectedToWork, const char* testName); |
| 22 | |
| 23 | // Ensure that the pixels can be copied from 'proxy' to an RGBA 8888 destination (both |
| 24 | // texture-backed and rendertarget-backed). |
Robert Phillips | 26c90e0 | 2017-03-14 14:39:29 -0400 | [diff] [blame] | 25 | void test_copy_from_surface(skiatest::Reporter*, GrContext*, |
Robert Phillips | 3500b77 | 2017-01-27 10:11:42 -0500 | [diff] [blame] | 26 | GrSurfaceProxy* proxy, uint32_t expectedPixelValues[], |
| 27 | bool onlyTestRTConfig, const char* testName); |
| 28 | |
| 29 | // Ensure that RGBA 8888 pixels can be copied into 'dstContext' |
Robert Phillips | 1afd4cd | 2018-01-08 13:40:32 -0500 | [diff] [blame] | 30 | void test_copy_to_surface(skiatest::Reporter*, GrProxyProvider*, |
Robert Phillips | 3500b77 | 2017-01-27 10:11:42 -0500 | [diff] [blame] | 31 | GrSurfaceContext* dstContext, const char* testName); |