TachyonUI 0.1.0
High-performance UI for building tools.
Loading...
Searching...
No Matches
tachyon::GradientHandle Struct Reference

Handle to a reference-counted GradientManager atlas slot. More...

#include <gui_core/style/gui_gradient_manager.h>

Public Member Functions

constexpr GradientHandle ()=default
constexpr GradientHandle (uint32_t v)
constexpr bool IsValid () const
 Not the invalid handle; GradientManager::IsValid also checks it's still live.
constexpr uint32_t SlotIndex () const
 1-based; 0 = invalid
constexpr uint8_t Generation () const
 wraps around
constexpr bool operator== (const GradientHandle &) const noexcept=default

Static Public Member Functions

static constexpr GradientHandle Invalid ()
 the invalid handle
static constexpr GradientHandle Make (uint32_t slotIndex1Based, uint8_t generation)
 Encodes a slot index (1-based) and generation.

Public Attributes

uint32_t value = 0
 encoded slot index and generation

Detailed Description

Handle to a reference-counted GradientManager atlas slot.

0 is invalid; otherwise the high 24 bits are the 1-based slot index and the low 8 bits its generation.

Each Acquire* (a new slot at refcount 1, or the existing handle on dedup) pairs with exactly one Release, as does each AddRef. At refcount 0 the slot is freed and its pixels may be reused.

Constructor & Destructor Documentation

◆ GradientHandle() [1/2]

tachyon::GradientHandle::GradientHandle ( )
constexprdefault

◆ GradientHandle() [2/2]

tachyon::GradientHandle::GradientHandle ( uint32_t v)
inlineexplicitconstexpr

Member Function Documentation

◆ IsValid()

bool tachyon::GradientHandle::IsValid ( ) const
inlineconstexpr

Not the invalid handle; GradientManager::IsValid also checks it's still live.

◆ SlotIndex()

uint32_t tachyon::GradientHandle::SlotIndex ( ) const
inlineconstexpr

1-based; 0 = invalid

◆ Generation()

uint8_t tachyon::GradientHandle::Generation ( ) const
inlineconstexpr

wraps around

◆ operator==()

bool tachyon::GradientHandle::operator== ( const GradientHandle & ) const
constexprdefaultnoexcept

◆ Invalid()

constexpr GradientHandle tachyon::GradientHandle::Invalid ( )
inlinestaticconstexpr

the invalid handle

◆ Make()

constexpr GradientHandle tachyon::GradientHandle::Make ( uint32_t slotIndex1Based,
uint8_t generation )
inlinestaticconstexpr

Encodes a slot index (1-based) and generation.

Member Data Documentation

◆ value

uint32_t tachyon::GradientHandle::value = 0

encoded slot index and generation


The documentation for this struct was generated from the following file: