Flutter Engine
The Flutter Engine
ProtectedUtils_Graphite.cpp
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
9
15
16using namespace skgpu;
17using namespace skgpu::graphite;
18
19namespace ProtectedUtils {
20
23 Protected isProtected) {
25
27 ii,
29 isProtected,
30 /* surfaceProps= */ nullptr);
31 if (!surface) {
32 SK_ABORT("Could not create %s surface.",
33 isProtected == Protected::kYes ? "protected" : "unprotected");
34 return nullptr;
35 }
36
37 SkCanvas* canvas = surface->getCanvas();
38
39 canvas->clear(SkColors::kBlue);
40
41 return surface;
42}
43
47 Protected isProtected) {
49
50 sk_sp<SkImage> image = sk_gpu_test::MakeBackendTextureImage(recorder,
51 ii,
52 color,
55 Origin::kTopLeft,
56 isProtected);
57 if (!image) {
58 SK_ABORT("Could not create %s image.",
59 isProtected == Protected::kYes ? "protected" : "unprotected");
60 return nullptr;
61 }
62
63 return image;
64}
65
66} // namespace ProtectedUtils
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
Definition: SkAlphaType.h:29
#define SK_ABORT(message,...)
Definition: SkAssert.h:70
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
Definition: SkColorType.h:24
void clear(SkColor color)
Definition: SkCanvas.h:1199
DlColor color
VkSurfaceKHR surface
Definition: main.cc:49
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)
constexpr SkColor4f kBlue
Definition: SkColor.h:442
sk_sp< const SkImage > image
Definition: SkRecords.h:269
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259
sk_sp< SkSurface > MakeBackendTextureSurface(GrDirectContext *dContext, const SkImageInfo &ii, GrSurfaceOrigin origin, int sampleCnt, skgpu::Mipmapped mipmapped, GrProtected isProtected, const SkSurfaceProps *props)
Definition: GpuTools.h:21
Protected
Definition: GpuTypes.h:61
Definition: SkSize.h:16
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)