Flutter Engine
The Flutter Engine
Classes | Public Member Functions | List of all members
skgpu::BulkUsePlotUpdater Class Reference

#include <AtlasTypes.h>

Classes

struct  PlotData
 

Public Member Functions

 BulkUsePlotUpdater ()
 
 BulkUsePlotUpdater (const BulkUsePlotUpdater &that)
 
bool add (const skgpu::AtlasLocator &atlasLocator)
 
void reset ()
 
int count () const
 
const PlotDataplotData (int index) const
 

Detailed Description

A class which can be handed back to an atlas for updating plots in bulk. The current max number of plots per page an atlas can handle is 32. If in the future this is insufficient then we can move to a 64 bit int.

Definition at line 377 of file AtlasTypes.h.

Constructor & Destructor Documentation

◆ BulkUsePlotUpdater() [1/2]

skgpu::BulkUsePlotUpdater::BulkUsePlotUpdater ( )
inline

Definition at line 379 of file AtlasTypes.h.

379 {
380 memset(fPlotAlreadyUpdated, 0, sizeof(fPlotAlreadyUpdated));
381 }

◆ BulkUsePlotUpdater() [2/2]

skgpu::BulkUsePlotUpdater::BulkUsePlotUpdater ( const BulkUsePlotUpdater that)
inline

Definition at line 382 of file AtlasTypes.h.

383 : fPlotsToUpdate(that.fPlotsToUpdate) {
384 memcpy(fPlotAlreadyUpdated, that.fPlotAlreadyUpdated, sizeof(fPlotAlreadyUpdated));
385 }

Member Function Documentation

◆ add()

bool skgpu::BulkUsePlotUpdater::add ( const skgpu::AtlasLocator atlasLocator)
inline

Definition at line 387 of file AtlasTypes.h.

387 {
388 int plotIdx = atlasLocator.plotIndex();
389 int pageIdx = atlasLocator.pageIndex();
390 if (this->find(pageIdx, plotIdx)) {
391 return false;
392 }
393 this->set(pageIdx, plotIdx);
394 return true;
395 }
uint32_t plotIndex() const
Definition: AtlasTypes.h:305
uint32_t pageIndex() const
Definition: AtlasTypes.h:303

◆ count()

int skgpu::BulkUsePlotUpdater::count ( ) const
inline

Definition at line 408 of file AtlasTypes.h.

408{ return fPlotsToUpdate.size(); }

◆ plotData()

const PlotData & skgpu::BulkUsePlotUpdater::plotData ( int  index) const
inline

Definition at line 410 of file AtlasTypes.h.

410{ return fPlotsToUpdate[index]; }

◆ reset()

void skgpu::BulkUsePlotUpdater::reset ( )
inline

Definition at line 397 of file AtlasTypes.h.

397 {
398 fPlotsToUpdate.clear();
399 memset(fPlotAlreadyUpdated, 0, sizeof(fPlotAlreadyUpdated));
400 }

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