blob: 1fe96bff7c15c33f4ba7d9bcfb9ff373150af613 [file] [log] [blame]
Robert Phillips3500b772017-01-27 10:11:42 -05001/*
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 Phillips3500b772017-01-27 10:11:42 -050010class GrSurfaceContext;
11class GrSurfaceProxy;
12
13// Ensure that reading back from 'srcContext' as RGBA 8888 matches 'expectedPixelValues
Robert Phillips26c90e02017-03-14 14:39:29 -040014void test_read_pixels(skiatest::Reporter*,
Robert Phillips3500b772017-01-27 10:11:42 -050015 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 Phillips26c90e02017-03-14 14:39:29 -040020void test_write_pixels(skiatest::Reporter*,
Robert Phillips3500b772017-01-27 10:11:42 -050021 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 Phillips26c90e02017-03-14 14:39:29 -040025void test_copy_from_surface(skiatest::Reporter*, GrContext*,
Robert Phillips3500b772017-01-27 10:11:42 -050026 GrSurfaceProxy* proxy, uint32_t expectedPixelValues[],
27 bool onlyTestRTConfig, const char* testName);
28
29// Ensure that RGBA 8888 pixels can be copied into 'dstContext'
Robert Phillips1afd4cd2018-01-08 13:40:32 -050030void test_copy_to_surface(skiatest::Reporter*, GrProxyProvider*,
Robert Phillips3500b772017-01-27 10:11:42 -050031 GrSurfaceContext* dstContext, const char* testName);