Flutter Engine
The Flutter Engine
|
#include <AtlasTypes.h>
Public Attributes | |
int | height |
int AtlasLocator * | atlasLocator |
const uint32_t | fPageIndex: 16 |
const uint32_t | fPlotIndex: 16 |
The backing texture for an atlas is broken into a spatial grid of Plots. The Plots keep track of subimage placement via their Rectanizer. A Plot may be subclassed if the atlas class needs to track additional information.
Definition at line 435 of file AtlasTypes.h.
skgpu::Plot::Plot | ( | int | pageIndex, |
int | plotIndex, | ||
AtlasGenerationCounter * | generationCounter, | ||
int | offX, | ||
int | offY, | ||
int | width, | ||
int | height, | ||
SkColorType | colorType, | ||
size_t | bpp | ||
) |
Definition at line 18 of file AtlasTypes.cpp.
bool skgpu::Plot::addSubImage | ( | int | width, |
int | height, | ||
const void * | image, | ||
AtlasLocator * | atlasLocator | ||
) |
Definition at line 123 of file AtlasTypes.cpp.
Create a clone of this plot. The cloned plot will take the place of the current plot in the atlas
Definition at line 497 of file AtlasTypes.h.
void skgpu::Plot::copySubImage | ( | const AtlasLocator & | atlasLocator, |
const void * | image | ||
) |
Definition at line 99 of file AtlasTypes.cpp.
void * skgpu::Plot::dataAt | ( | const AtlasLocator & | atlasLocator | ) |
Definition at line 71 of file AtlasTypes.cpp.
|
inline |
Definition at line 483 of file AtlasTypes.h.
|
inline |
genID() is incremented when the plot is evicted due to a atlas spill. It is used to know if a particular subimage is still present in the atlas.
Definition at line 450 of file AtlasTypes.h.
|
inline |
Definition at line 485 of file AtlasTypes.h.
|
inline |
To manage the lifetime of a plot, we use two tokens. We use the last upload token to know when we can 'piggy back' uploads, i.e. if the last upload hasn't been flushed to the gpu, we don't need to issue a new upload even if we update the cpu backing store. We use lastUse to determine when we can evict a plot from the cache, i.e. if the last use has already flushed through the gpu then we can reuse the plot.
Definition at line 478 of file AtlasTypes.h.
|
inline |
Definition at line 479 of file AtlasTypes.h.
|
inline |
Definition at line 491 of file AtlasTypes.h.
|
inline |
Definition at line 487 of file AtlasTypes.h.
|
inline |
Definition at line 442 of file AtlasTypes.h.
|
inline |
plotIndex() is a unique id for the plot relative to the owning GrAtlas and page.
Definition at line 445 of file AtlasTypes.h.
|
inline |
Definition at line 451 of file AtlasTypes.h.
std::pair< const void *, SkIRect > skgpu::Plot::prepareForUpload | ( | ) |
Definition at line 132 of file AtlasTypes.cpp.
SkIPoint skgpu::Plot::prepForRender | ( | const AtlasLocator & | al, |
SkAutoPixmapStorage * | pixmap | ||
) |
Definition at line 89 of file AtlasTypes.cpp.
|
inline |
Definition at line 484 of file AtlasTypes.h.
void skgpu::Plot::resetRects | ( | ) |
Definition at line 160 of file AtlasTypes.cpp.
|
inline |
Definition at line 480 of file AtlasTypes.h.
|
inline |
Definition at line 481 of file AtlasTypes.h.
skgpu::Plot::SkDEBUGCODE | ( | size_t bpp() const { return fBytesPerPixel;} | ) |
To add data to the Plot, first call addRect to see if it's possible. If successful, use the atlasLocator to get a pointer to the location in the atlas via dataAt() and render to that location, or if you already have data use copySubImage().
int AtlasLocator* skgpu::Plot::atlasLocator |
Definition at line 462 of file AtlasTypes.h.
const uint32_t skgpu::Plot::fPageIndex |
Definition at line 518 of file AtlasTypes.h.
const uint32_t skgpu::Plot::fPlotIndex |
Definition at line 519 of file AtlasTypes.h.
int skgpu::Plot::height |
Definition at line 462 of file AtlasTypes.h.