#include <KeyBuilder.h>
Definition at line 20 of file KeyBuilder.h.
◆ KeyBuilder()
Definition at line 22 of file KeyBuilder.h.
std::shared_ptr< const fml::Mapping > data
◆ ~KeyBuilder()
virtual skgpu::KeyBuilder::~KeyBuilder |
( |
| ) |
|
|
inlinevirtual |
◆ add32()
void skgpu::KeyBuilder::add32 |
( |
uint32_t |
v, |
|
|
std::string_view |
label = "unknown" |
|
) |
| |
|
inline |
Definition at line 58 of file KeyBuilder.h.
58 {
60 }
virtual void addBits(uint32_t numBits, uint32_t val, std::string_view label)
◆ addBits()
virtual void skgpu::KeyBuilder::addBits |
( |
uint32_t |
numBits, |
|
|
uint32_t |
val, |
|
|
std::string_view |
label |
|
) |
| |
|
inlinevirtual |
Reimplemented in skgpu::StringKeyBuilder.
Definition at line 29 of file KeyBuilder.h.
29 {
30 SkASSERT(numBits > 0 && numBits <= 32);
31 SkASSERT(numBits == 32 || (val < (1u << numBits)));
32
33 fCurValue |= (val << fBitsUsed);
34 fBitsUsed += numBits;
35
36 if (fBitsUsed >= 32) {
37
39 uint32_t excess = fBitsUsed - 32;
40 fCurValue = excess ? (val >> (numBits - excess)) : 0;
41 fBitsUsed = excess;
42 }
43
44 SkASSERT(fCurValue < (1u << fBitsUsed));
45 }
◆ addBool()
void skgpu::KeyBuilder::addBool |
( |
bool |
b, |
|
|
std::string_view |
label |
|
) |
| |
|
inline |
◆ addBytes()
void skgpu::KeyBuilder::addBytes |
( |
uint32_t |
numBytes, |
|
|
const void * |
data, |
|
|
std::string_view |
label |
|
) |
| |
|
inline |
Definition at line 47 of file KeyBuilder.h.
47 {
48 const uint8_t* bytes =
reinterpret_cast<const uint8_t*
>(
data);
49 for (; numBytes --> 0; bytes++) {
50 this->
addBits(8, *bytes, label);
51 }
52 }
◆ appendComment()
virtual void skgpu::KeyBuilder::appendComment |
( |
const char * |
comment | ) |
|
|
inlinevirtual |
◆ flush()
void skgpu::KeyBuilder::flush |
( |
| ) |
|
|
inline |
Definition at line 66 of file KeyBuilder.h.
66 {
67 if (fBitsUsed) {
69 fCurValue = 0;
70 fBitsUsed = 0;
71 }
72 }
The documentation for this class was generated from the following file: