FastUIDraw
Public Member Functions | Friends | List of all members
fastuidraw::ColorStopAtlas Class Reference

A ColorStopAtlas is a common location to all color stop data of an application. Ideally, all color stop sequences are placed into a single ColorStopAtlas (changes of ColorStopAtlas force draw-call breaks). More...

#include <colorstop_atlas.hpp>

Inheritance diagram for fastuidraw::ColorStopAtlas:
Inheritance graph
[legend]

Public Member Functions

 ColorStopAtlas (reference_counted_ptr< ColorStopBackingStore > pbacking_store)
 
reference_counted_ptr< const ColorStopBackingStorebacking_store (void) const
 
reference_counted_ptr< ColorStopSequencecreate (const ColorStopArray &color_stops, unsigned int pwidth)
 
void flush (void) const
 
void lock_resources (void)
 
unsigned int max_width (void) const
 
void unlock_resources (void)
 
- Public Member Functions inherited from fastuidraw::reference_counted_base< T, Counter >
 reference_counted_base (void)
 

Friends

class ColorStopSequence
 

Additional Inherited Members

- Static Public Member Functions inherited from fastuidraw::reference_counted_base< T, Counter >
static void add_reference (const reference_counted_base< T, Counter > *p)
 
static void remove_reference (const reference_counted_base< T, Counter > *p)
 

Detailed Description

A ColorStopAtlas is a common location to all color stop data of an application. Ideally, all color stop sequences are placed into a single ColorStopAtlas (changes of ColorStopAtlas force draw-call breaks).

Definition at line 131 of file colorstop_atlas.hpp.

Constructor & Destructor Documentation

◆ ColorStopAtlas()

fastuidraw::ColorStopAtlas::ColorStopAtlas ( reference_counted_ptr< ColorStopBackingStore pbacking_store)
explicit

Ctor.

Parameters
pbacking_storehandle to the ColorStopBackingStore object to which the atlas will store color stops

Member Function Documentation

◆ backing_store()

reference_counted_ptr<const ColorStopBackingStore> fastuidraw::ColorStopAtlas::backing_store ( void  ) const

Returns a handle to the backing store of the atlas.

◆ create()

reference_counted_ptr<ColorStopSequence> fastuidraw::ColorStopAtlas::create ( const ColorStopArray color_stops,
unsigned int  pwidth 
)

Create a ColorStopSequence onto this ColorStopAtlas.

Parameters
color_stopssource color stops to use
pwidthspecifies number of texels to occupy on the ColorStopAtlas. The discretization of the color stop values is specified by the width. Additionally, the width is clamped to max_width().

◆ flush()

void fastuidraw::ColorStopAtlas::flush ( void  ) const

Calls ColorStopBackingStore::flush() on the backing store (see backing_store()).

◆ lock_resources()

void fastuidraw::ColorStopAtlas::lock_resources ( void  )

Increments an internal counter. If this internal counter is greater than zero, then the reurning of interval to the free store for later use is -delayed- until the counter reaches zero again (see unlock_resources()). The use case is for buffered painting where the GPU calls are delayed for later (to batch commands) and an Image may go out of scope before the GPU commands are sent to the GPU. By delaying the return of intervals to the freestore, the color stop data is valid still for rendering even if the owning ColorStopSequence has been deleted.

◆ max_width()

unsigned int fastuidraw::ColorStopAtlas::max_width ( void  ) const

Returns the width of the ColorStopBackingStore of the atlas.

◆ unlock_resources()

void fastuidraw::ColorStopAtlas::unlock_resources ( void  )

Decrements an internal counter. If this internal counter reaches zero, those intervals from those ColorStopSequence objects that were deleted while the counter was non-zero, are then returned to the interval free store. See lock_resources() for more details.


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