Brian Salomon | 72c7b98 | 2020-10-06 10:07:38 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2020 Google LLC |
| 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 | #ifndef TestSurface_DEFINED |
| 9 | #define TestSurface_DEFINED |
| 10 | |
| 11 | #include "include/core/SkImageInfo.h" |
| 12 | #include "include/core/SkSize.h" |
| 13 | #include "include/gpu/GrTypes.h" |
| 14 | #include "include/private/SkColorData.h" |
| 15 | |
| 16 | class GrDirectContext; |
| 17 | class SkSurface; |
| 18 | class SkSurfaceProps; |
| 19 | |
Brian Salomon | f9b0042 | 2020-10-08 16:00:14 -0400 | [diff] [blame] | 20 | namespace sk_gpu_test { |
| 21 | |
| 22 | sk_sp<SkSurface> MakeBackendTextureSurface(GrDirectContext*, |
Brian Salomon | 7205080 | 2020-10-12 20:45:06 -0400 | [diff] [blame] | 23 | const SkImageInfo&, |
| 24 | GrSurfaceOrigin, |
| 25 | int sampleCnt, |
| 26 | GrMipmapped = GrMipmapped::kNo, |
| 27 | GrProtected = GrProtected::kNo, |
| 28 | const SkSurfaceProps* = nullptr); |
| 29 | |
| 30 | sk_sp<SkSurface> MakeBackendTextureSurface(GrDirectContext*, |
Brian Salomon | f9b0042 | 2020-10-08 16:00:14 -0400 | [diff] [blame] | 31 | SkISize, |
| 32 | GrSurfaceOrigin, |
| 33 | int sampleCnt, |
| 34 | SkColorType, |
| 35 | sk_sp<SkColorSpace> = nullptr, |
| 36 | GrMipmapped = GrMipmapped::kNo, |
| 37 | GrProtected = GrProtected::kNo, |
| 38 | const SkSurfaceProps* = nullptr); |
| 39 | |
Brian Salomon | 72c7b98 | 2020-10-06 10:07:38 -0400 | [diff] [blame] | 40 | /** Creates an SkSurface backed by a non-textureable render target. */ |
| 41 | sk_sp<SkSurface> MakeBackendRenderTargetSurface(GrDirectContext*, |
Brian Salomon | 7205080 | 2020-10-12 20:45:06 -0400 | [diff] [blame] | 42 | const SkImageInfo&, |
| 43 | GrSurfaceOrigin, |
| 44 | int sampleCnt, |
| 45 | GrProtected = GrProtected::kNo, |
| 46 | const SkSurfaceProps* = nullptr); |
| 47 | |
| 48 | sk_sp<SkSurface> MakeBackendRenderTargetSurface(GrDirectContext*, |
Brian Salomon | 72c7b98 | 2020-10-06 10:07:38 -0400 | [diff] [blame] | 49 | SkISize, |
Brian Salomon | 72c7b98 | 2020-10-06 10:07:38 -0400 | [diff] [blame] | 50 | GrSurfaceOrigin, |
Brian Salomon | f9b0042 | 2020-10-08 16:00:14 -0400 | [diff] [blame] | 51 | int sampleCnt, |
Brian Salomon | 72c7b98 | 2020-10-06 10:07:38 -0400 | [diff] [blame] | 52 | SkColorType, |
| 53 | sk_sp<SkColorSpace> = nullptr, |
Brian Salomon | f9b0042 | 2020-10-08 16:00:14 -0400 | [diff] [blame] | 54 | GrProtected = GrProtected::kNo, |
Brian Salomon | 72c7b98 | 2020-10-06 10:07:38 -0400 | [diff] [blame] | 55 | const SkSurfaceProps* = nullptr); |
Brian Salomon | f9b0042 | 2020-10-08 16:00:14 -0400 | [diff] [blame] | 56 | } // namespace sk_gpu_test |
Brian Salomon | 72c7b98 | 2020-10-06 10:07:38 -0400 | [diff] [blame] | 57 | |
| 58 | #endif |