8#ifndef GrDrawOpAtlas_DEFINED
9#define GrDrawOpAtlas_DEFINED
81 int plotWidth,
int plotHeight,
85 std::string_view label);
123 uint64_t plotGeneration = fPages[
page].fPlotArray[
plot]->genID();
124 uint64_t locatorGeneration = plotLocator.
genID();
125 return plot < fNumPlots &&
page < fNumActivePages && plotGeneration == locatorGeneration;
131 uint32_t plotIdx = atlasLocator.
plotIndex();
133 uint32_t pageIdx = atlasLocator.
pageIndex();
134 SkASSERT(pageIdx < fNumActivePages);
136 this->makeMRU(
plot, pageIdx);
137 plot->setLastUseToken(token);
152 plot->setLastUseToken(token);
169 int width,
int height,
int plotWidth,
int plotHeight,
176 if (fPages[pageIdx].fPlotList.head() ==
plot) {
180 fPages[pageIdx].fPlotList.remove(
plot);
181 fPages[pageIdx].fPlotList.addToHead(
plot);
196 void deactivateLastPage();
200 this->processEviction(
plot->plotLocator());
206 size_t fBytesPerPixel;
211 unsigned int fNumPlots;
212 const std::string fLabel;
220 uint64_t fAtlasGeneration;
226 int fFlushesSinceLastUse;
228 std::vector<skgpu::PlotEvictionCallback*> fEvictionCallbacks;
232 std::unique_ptr<sk_sp<skgpu::Plot>[]> fPlotArray;
241 uint32_t fNumActivePages;
268 inline static constexpr int kMaxAtlasDim = 2048;
std::function< bool(GrTextureProxy *, SkIRect, GrColorType srcColorType, const void *, size_t rowBytes)> GrDeferredTextureUploadWritePixelsFn
@ kYes
Do pre-clip the geometry before applying the (perspective) matrix.
@ kNo
Don't pre-clip the geometry before applying the (perspective) matrix.
SkDEBUGCODE(SK_SPI) SkThreadID SkGetThreadID()
SkISize atlasDimensions(skgpu::MaskFormat type) const
SkISize plotDimensions(skgpu::MaskFormat type) const
void compact(skgpu::AtlasToken startTokenForNextFlush)
uint64_t atlasGeneration() const
uint32_t numActivePages()
static std::unique_ptr< GrDrawOpAtlas > Make(GrProxyProvider *proxyProvider, const GrBackendFormat &format, SkColorType ct, size_t bpp, int width, int height, int plotWidth, int plotHeight, skgpu::AtlasGenerationCounter *generationCounter, AllowMultitexturing allowMultitexturing, skgpu::PlotEvictionCallback *evictor, std::string_view label)
const GrSurfaceProxyView * getViews() const
void setLastUseToken(const skgpu::AtlasLocator &atlasLocator, skgpu::AtlasToken token)
bool hasID(const skgpu::PlotLocator &plotLocator)
void setLastUseTokenBulk(const skgpu::BulkUsePlotUpdater &updater, skgpu::AtlasToken token)
ErrorCode addToAtlas(GrResourceProvider *, GrDeferredUploadTarget *, int width, int height, const void *image, skgpu::AtlasLocator *)
void instantiate(GrOnFlushResourceProvider *)
uint32_t maxPages() const
uint32_t plotIndex() const
PlotLocator plotLocator() const
uint32_t pageIndex() const
const PlotData & plotData(int index) const
static constexpr auto kMaxMultitexturePages
uint32_t plotIndex() const
uint32_t pageIndex() const
uint32_t uint32_t * format
sk_sp< const SkImage > image
static void plot(SkCanvas *canvas, const char *fn, float xMin, float xMax, float yMin, float yMax, const char *label=nullptr, bool requireES3=false)