Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
BackendSurfaceFactory.h
Go to the documentation of this file.
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
13#include "include/core/SkSize.h"
15#include "include/gpu/GrTypes.h"
17
18class GrDirectContext;
19class SkSurface;
20class SkSurfaceProps;
21enum SkColorType : int;
22struct SkImageInfo;
23
24#ifdef SK_GRAPHITE
25namespace skgpu::graphite {
26 class Recorder;
27}
28#endif
29
30namespace sk_gpu_test {
31
33 const SkImageInfo&,
35 int sampleCnt,
36 skgpu::Mipmapped = skgpu::Mipmapped::kNo,
37 GrProtected = GrProtected::kNo,
38 const SkSurfaceProps* = nullptr);
39
41 SkISize,
43 int sampleCnt,
45 sk_sp<SkColorSpace> = nullptr,
46 skgpu::Mipmapped = skgpu::Mipmapped::kNo,
47 GrProtected = GrProtected::kNo,
48 const SkSurfaceProps* = nullptr);
49
50/** Creates an SkSurface backed by a non-textureable render target. */
52 const SkImageInfo&,
54 int sampleCnt,
55 GrProtected = GrProtected::kNo,
56 const SkSurfaceProps* = nullptr);
57
59 SkISize,
61 int sampleCnt,
63 sk_sp<SkColorSpace> = nullptr,
64 GrProtected = GrProtected::kNo,
65 const SkSurfaceProps* = nullptr);
66
67#ifdef SK_GRAPHITE
68/*
69 * Graphite version of MakeBackendTextureSurface
70 */
72 const SkImageInfo&,
73 skgpu::Mipmapped = skgpu::Mipmapped::kNo,
74 skgpu::Protected = skgpu::Protected::kNo,
75 const SkSurfaceProps* = nullptr);
76/*
77 * Variation that wraps a WGPUTextureView. Only supported on Dawn backend.
78 */
79sk_sp<SkSurface> MakeBackendTextureViewSurface(skgpu::graphite::Recorder*,
80 const SkImageInfo&,
81 skgpu::Mipmapped = skgpu::Mipmapped::kNo,
82 skgpu::Protected = skgpu::Protected::kNo,
83 const SkSurfaceProps* = nullptr);
84#endif // SK_GRAPHITE
85
86} // namespace sk_gpu_test
87
88#endif
GrSurfaceOrigin
Definition GrTypes.h:147
SkColorType
Definition SkColorType.h:19
Type::kYUV Type::kRGBA() int(0.7 *637)
sk_sp< SkSurface > MakeBackendRenderTargetSurface(GrDirectContext *dContext, const SkImageInfo &ii, GrSurfaceOrigin origin, int sampleCnt, GrProtected isProtected, const SkSurfaceProps *props)
sk_sp< SkSurface > MakeBackendTextureSurface(GrDirectContext *dContext, const SkImageInfo &ii, GrSurfaceOrigin origin, int sampleCnt, skgpu::Mipmapped mipmapped, GrProtected isProtected, const SkSurfaceProps *props)
Mipmapped
Definition GpuTypes.h:53
Protected
Definition GpuTypes.h:61