Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
ProtectedUtils.h
Go to the documentation of this file.
1/*
2 * Copyright 2023 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 ProtectedUtils_DEFINED
9#define ProtectedUtils_DEFINED
10
13
14class GrDirectContext;
15class SkImage;
16class SkSurface;
17class SkSurfaceProps;
18struct SkISize;
19
20#ifdef SK_GRAPHITE
21namespace skgpu {
22 enum class Protected : bool;
23}
24namespace skgpu::graphite {
25 class Recorder;
26}
27#endif
28
29namespace ProtectedUtils {
30
31/*
32 * These factories create Surfaces and Images with an explicitly specified protected status.
33 * If the Surface/Image cannot be created with the specified protected status nullptr will
34 * be returned.
35 */
36
38 SkISize size,
39 bool textureable,
40 bool isProtected,
41 const SkSurfaceProps* = nullptr);
42
43void CheckImageBEProtection(SkImage*, bool expectingProtected);
44
46 SkISize size,
48 bool isProtected);
49
50#ifdef SK_GRAPHITE
52 SkISize size,
54
56 SkISize size,
59#endif
60
61} // namespace ProtectedUtils
62
63#endif // ProtectedUtils_DEFINED
SkColor4f color
sk_sp< SkSurface > CreateProtectedSkSurface(GrDirectContext *dContext, SkISize size, bool textureable, bool isProtected, const SkSurfaceProps *surfaceProps)
sk_sp< SkImage > CreateProtectedSkImage(GrDirectContext *dContext, SkISize size, SkColor4f color, bool isProtected)
void CheckImageBEProtection(SkImage *image, bool expectingProtected)
Protected
Definition GpuTypes.h:61