blob: ca35a47ed0d8ddcaea5067072e95146f5cb841fa [file] [log] [blame]
Brian Salomon72c7b982020-10-06 10:07:38 -04001/*
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
16class GrDirectContext;
17class SkSurface;
18class SkSurfaceProps;
19
Brian Salomonf9b00422020-10-08 16:00:14 -040020namespace sk_gpu_test {
21
22sk_sp<SkSurface> MakeBackendTextureSurface(GrDirectContext*,
Brian Salomon72050802020-10-12 20:45:06 -040023 const SkImageInfo&,
24 GrSurfaceOrigin,
25 int sampleCnt,
26 GrMipmapped = GrMipmapped::kNo,
27 GrProtected = GrProtected::kNo,
28 const SkSurfaceProps* = nullptr);
29
30sk_sp<SkSurface> MakeBackendTextureSurface(GrDirectContext*,
Brian Salomonf9b00422020-10-08 16:00:14 -040031 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 Salomon72c7b982020-10-06 10:07:38 -040040/** Creates an SkSurface backed by a non-textureable render target. */
41sk_sp<SkSurface> MakeBackendRenderTargetSurface(GrDirectContext*,
Brian Salomon72050802020-10-12 20:45:06 -040042 const SkImageInfo&,
43 GrSurfaceOrigin,
44 int sampleCnt,
45 GrProtected = GrProtected::kNo,
46 const SkSurfaceProps* = nullptr);
47
48sk_sp<SkSurface> MakeBackendRenderTargetSurface(GrDirectContext*,
Brian Salomon72c7b982020-10-06 10:07:38 -040049 SkISize,
Brian Salomon72c7b982020-10-06 10:07:38 -040050 GrSurfaceOrigin,
Brian Salomonf9b00422020-10-08 16:00:14 -040051 int sampleCnt,
Brian Salomon72c7b982020-10-06 10:07:38 -040052 SkColorType,
53 sk_sp<SkColorSpace> = nullptr,
Brian Salomonf9b00422020-10-08 16:00:14 -040054 GrProtected = GrProtected::kNo,
Brian Salomon72c7b982020-10-06 10:07:38 -040055 const SkSurfaceProps* = nullptr);
Brian Salomonf9b00422020-10-08 16:00:14 -040056} // namespace sk_gpu_test
Brian Salomon72c7b982020-10-06 10:07:38 -040057
58#endif