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 | |
| 10 | #if SK_SUPPORT_GPU |
| 11 | |
| 12 | class GrSurfaceContext; |
| 13 | class GrSurfaceProxy; |
| 14 | |
| 15 | // Ensure that reading back from 'srcContext' as RGBA 8888 matches 'expectedPixelValues |
Robert Phillips | 26c90e0 | 2017-03-14 14:39:29 -0400 | [diff] [blame] | 16 | void test_read_pixels(skiatest::Reporter*, |
Robert Phillips | 3500b77 | 2017-01-27 10:11:42 -0500 | [diff] [blame] | 17 | GrSurfaceContext* srcContext, uint32_t expectedPixelValues[], |
| 18 | const char* testName); |
| 19 | |
| 20 | // See if trying to write RGBA 8888 pixels to 'dstContext' matches matches the |
| 21 | // expectation ('expectedToWork') |
Robert Phillips | 26c90e0 | 2017-03-14 14:39:29 -0400 | [diff] [blame] | 22 | void test_write_pixels(skiatest::Reporter*, |
Robert Phillips | 3500b77 | 2017-01-27 10:11:42 -0500 | [diff] [blame] | 23 | GrSurfaceContext* srcContext, bool expectedToWork, const char* testName); |
| 24 | |
| 25 | // Ensure that the pixels can be copied from 'proxy' to an RGBA 8888 destination (both |
| 26 | // texture-backed and rendertarget-backed). |
Robert Phillips | 26c90e0 | 2017-03-14 14:39:29 -0400 | [diff] [blame] | 27 | void test_copy_from_surface(skiatest::Reporter*, GrContext*, |
Robert Phillips | 3500b77 | 2017-01-27 10:11:42 -0500 | [diff] [blame] | 28 | GrSurfaceProxy* proxy, uint32_t expectedPixelValues[], |
| 29 | bool onlyTestRTConfig, const char* testName); |
| 30 | |
| 31 | // Ensure that RGBA 8888 pixels can be copied into 'dstContext' |
Robert Phillips | 26c90e0 | 2017-03-14 14:39:29 -0400 | [diff] [blame] | 32 | void test_copy_to_surface(skiatest::Reporter*, GrResourceProvider*, |
Robert Phillips | 3500b77 | 2017-01-27 10:11:42 -0500 | [diff] [blame] | 33 | GrSurfaceContext* dstContext, const char* testName); |
| 34 | #endif |