The atlas that the colors of color styles are baked into: pages of 2D textures, one row per gradient, with solid and 2..4-color blocks packed into shared rows.
More...
|
| | GradientManager (size_t width=256) |
| | An empty atlas whose pages are width texels wide.
|
| void | ReleaseAll (GraphicsContext *graphicsContext) |
| | Destroys every GPU image of the atlas (deferred through graphicsContext).
|
| void | AddRef (GradientHandle handle) |
| | Raises the refcount of a live handle; pair with one Release.
|
| bool | Release (GradientHandle handle) |
| | Lowers the refcount; true when it reached zero and the slot was reclaimed.
|
| AtlasLocation | GetLocation (GradientHandle handle) const |
| | The atlas position of a handle; all zero for an invalid or stale handle.
|
| bool | IsValid (GradientHandle handle) const |
| | True if the handle is live (slot occupied and generation matches).
|
| uint16_t | GetRefcount (GradientHandle handle) const |
| | Refcount of a live handle; 0 for an invalid or stale handle.
|
| size_t | Width () const noexcept |
| | Page width in texels, the same for every page.
|
| uint32_t | PageCount () const noexcept |
| | Number of pages allocated.
|
| size_t | PageHeight (uint32_t pageIndex) const noexcept |
| | Allocated height of a page in rows; the rows in use are at most this.
|
| std::span< const color4b > | PageTextureData (uint32_t pageIndex) const noexcept |
| | CPU texels of a page, PageHeight x Width.
|
| std::span< color4b > | PageTextureData (uint32_t pageIndex) noexcept |
| | Writable CPU texels of a page; call MarkPageModified after writing.
|
| void | MarkPageModified (uint32_t pageIndex) noexcept |
| | Makes the next GetGradientImage upload the whole page.
|
| void | ClearAll () noexcept |
| | Releases every slot; every outstanding GradientHandle becomes stale, so holders (StyleManager, the text system's caret) re-register.
|
| tachyon::Image * | GetGradientImage (GraphicsContext *graphicsContext, uint32_t pageIndex=0) |
| | The GPU image of a page, made when it's new or has grown; otherwise the rows written since go up into it (GraphicsContext::UpdateImageRows), or, where the backend can't, it's made again.
|
|
A slot holding the colors (solid, 2..4-color block or full gradient row).
Identical content returns the same handle with its refcount raised; each call pairs with one Release.
|
| GradientHandle | AcquireSolidColor (const color4b &color) |
| | A full row of these pixels (a GradientF's WriteTo, say), resampled to Width() when it's another size.
|
| GradientHandle | AcquireSolidColor (const color4f &color) |
| | A full row of these pixels (a GradientF's WriteTo, say), resampled to Width() when it's another size.
|
| GradientHandle | AcquireColors (const color4b &c0, const color4b &c1) |
| | A full row of these pixels (a GradientF's WriteTo, say), resampled to Width() when it's another size.
|
| GradientHandle | AcquireColors (const color4f &c0, const color4f &c1) |
| | A full row of these pixels (a GradientF's WriteTo, say), resampled to Width() when it's another size.
|
| GradientHandle | AcquireColors (const color4b &c0, const color4b &c1, const color4b &c2) |
| | A full row of these pixels (a GradientF's WriteTo, say), resampled to Width() when it's another size.
|
| GradientHandle | AcquireColors (const color4f &c0, const color4f &c1, const color4f &c2) |
| | A full row of these pixels (a GradientF's WriteTo, say), resampled to Width() when it's another size.
|
| GradientHandle | AcquireColors (const color4b &c0, const color4b &c1, const color4b &c2, const color4b &c3) |
| | A full row of these pixels (a GradientF's WriteTo, say), resampled to Width() when it's another size.
|
| GradientHandle | AcquireColors (const color4f &c0, const color4f &c1, const color4f &c2, const color4f &c3) |
| | A full row of these pixels (a GradientF's WriteTo, say), resampled to Width() when it's another size.
|
| GradientHandle | AcquireGradient (const Gradient &g) |
| | A full row of these pixels (a GradientF's WriteTo, say), resampled to Width() when it's another size.
|
| GradientHandle | AcquireRowPixels (std::span< const color4b > pixels) |
| | A full row of these pixels (a GradientF's WriteTo, say), resampled to Width() when it's another size.
|
The atlas that the colors of color styles are baked into: pages of 2D textures, one row per gradient, with solid and 2..4-color blocks packed into shared rows.
Slots are reference counted and deduplicated by content; a slot is reclaimed at refcount 0 and may be reused by a later Acquire.
A page doubles its height up to kMaxPageHeight; then a new page is added. A grown page's old GPU image is destroyed at the end of the frame.