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/SkColorSpace.h" 12 #include "include/core/SkRefCnt.h" 13 #include "include/core/SkSize.h" 14 #include "include/gpu/GpuTypes.h" 15 #include "include/gpu/GrTypes.h" 16 #include "include/private/SkColorData.h" 17 18 class GrDirectContext; 19 class SkSurface; 20 class SkSurfaceProps; 21 enum SkColorType : int; 22 struct SkImageInfo; 23 24 namespace sk_gpu_test { 25 26 sk_sp<SkSurface> MakeBackendTextureSurface(GrDirectContext*, 27 const SkImageInfo&, 28 GrSurfaceOrigin, 29 int sampleCnt, 30 skgpu::Mipmapped = skgpu::Mipmapped::kNo, 31 GrProtected = GrProtected::kNo, 32 const SkSurfaceProps* = nullptr); 33 34 sk_sp<SkSurface> MakeBackendTextureSurface(GrDirectContext*, 35 SkISize, 36 GrSurfaceOrigin, 37 int sampleCnt, 38 SkColorType, 39 sk_sp<SkColorSpace> = nullptr, 40 skgpu::Mipmapped = skgpu::Mipmapped::kNo, 41 GrProtected = GrProtected::kNo, 42 const SkSurfaceProps* = nullptr); 43 44 /** Creates an SkSurface backed by a non-textureable render target. */ 45 sk_sp<SkSurface> MakeBackendRenderTargetSurface(GrDirectContext*, 46 const SkImageInfo&, 47 GrSurfaceOrigin, 48 int sampleCnt, 49 GrProtected = GrProtected::kNo, 50 const SkSurfaceProps* = nullptr); 51 52 sk_sp<SkSurface> MakeBackendRenderTargetSurface(GrDirectContext*, 53 SkISize, 54 GrSurfaceOrigin, 55 int sampleCnt, 56 SkColorType, 57 sk_sp<SkColorSpace> = nullptr, 58 GrProtected = GrProtected::kNo, 59 const SkSurfaceProps* = nullptr); 60 } // namespace sk_gpu_test 61 62 #endif 63