Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
src
gpu
graphite
GraphiteResourceKey.cpp
Go to the documentation of this file.
1
/*
2
* Copyright 2022 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
#include "
src/gpu/graphite/GraphiteResourceKey.h
"
9
10
namespace
skgpu::graphite
{
11
12
ResourceType
GraphiteResourceKey::GenerateResourceType
() {
13
static
std::atomic<int32_t> nextType{
ResourceKey::kInvalidDomain
+ 1};
14
15
int32_t
type
= nextType.fetch_add(1, std::memory_order_relaxed);
16
if
(
type
> SkTo<int32_t>(UINT16_MAX)) {
17
SK_ABORT
(
"Too many Graphite Resource Types"
);
18
}
19
20
return
static_cast<
ResourceType
>
(
type
);
21
}
22
23
}
// namespace skgpu::graphite
24
GraphiteResourceKey.h
SK_ABORT
#define SK_ABORT(message,...)
Definition
SkAssert.h:70
skgpu::ResourceKey::kInvalidDomain
static const uint32_t kInvalidDomain
Definition
ResourceKey.h:95
skgpu::graphite::GraphiteResourceKey::GenerateResourceType
static ResourceType GenerateResourceType()
Definition
GraphiteResourceKey.cpp:12
type
uint8_t type
Definition
fl_standard_message_codec_test.cc:1115
skgpu::graphite
Definition
BoundsManagerBench.cpp:27
skgpu::graphite::ResourceType
uint32_t ResourceType
Definition
ResourceTypes.h:133
Generated on Fri Apr 26 2024 06:17:18 for Flutter Engine by
1.9.8