• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
20 namespace sk_gpu_test {
21 
22 sk_sp<SkSurface> MakeBackendTextureSurface(GrDirectContext*,
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*,
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 
40 /** Creates an SkSurface backed by a non-textureable render target. */
41 sk_sp<SkSurface> MakeBackendRenderTargetSurface(GrDirectContext*,
42                                                 const SkImageInfo&,
43                                                 GrSurfaceOrigin,
44                                                 int sampleCnt,
45                                                 GrProtected = GrProtected::kNo,
46                                                 const SkSurfaceProps* = nullptr);
47 
48 sk_sp<SkSurface> MakeBackendRenderTargetSurface(GrDirectContext*,
49                                                 SkISize,
50                                                 GrSurfaceOrigin,
51                                                 int sampleCnt,
52                                                 SkColorType,
53                                                 sk_sp<SkColorSpace> = nullptr,
54                                                 GrProtected = GrProtected::kNo,
55                                                 const SkSurfaceProps* = nullptr);
56 }  // namespace sk_gpu_test
57 
58 #endif
59