Flutter Engine
The Flutter Engine
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
ResourceKey.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2021 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
10#include "src/core/SkChecksum.h"
11
12#include <atomic>
13
14namespace skgpu {
15
17 static std::atomic<int32_t> nextType{ResourceKey::kInvalidDomain + 1};
18
19 int32_t type = nextType.fetch_add(1, std::memory_order_relaxed);
20 if (type > SkTo<int32_t>(UINT16_MAX)) {
21 SK_ABORT("Too many Resource Types");
22 }
23
24 return static_cast<ResourceType>(type);
25}
26
28 static std::atomic<int32_t> nextDomain{ResourceKey::kInvalidDomain + 1};
29
30 int32_t domain = nextDomain.fetch_add(1, std::memory_order_relaxed);
31 if (domain > SkTo<int32_t>(UINT16_MAX)) {
32 SK_ABORT("Too many skgpu::UniqueKey Domains");
33 }
34
35 return static_cast<Domain>(domain);
36}
37
38uint32_t ResourceKeyHash(const uint32_t* data, size_t size) {
40}
41
42} // namespace skgpu
43
#define SK_ABORT(message,...)
Definition: SkAssert.h:70
GLenum type
static const uint32_t kInvalidDomain
Definition: ResourceKey.h:95
uint32_t domain() const
Definition: ResourceKey.h:121
static ResourceType GenerateResourceType()
Definition: ResourceKey.cpp:16
uint32_t ResourceType
Definition: ResourceKey.h:200
static Domain GenerateDomain()
Definition: ResourceKey.cpp:27
uint32_t Hash32(const void *data, size_t bytes, uint32_t seed)
Definition: SkChecksum.cpp:113
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
Definition: GpuTools.h:21
uint32_t ResourceKeyHash(const uint32_t *data, size_t size)
Definition: ResourceKey.cpp:38
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63