14#if !defined(SK_ENABLE_OPTIMIZE_SIZE)
18#ifdef DF_PATH_TRACKING
19static int g_NumCachedShapes = 0;
20static int g_NumFreedShapes = 0;
32 ShapeDataList::Iter iter;
33 iter.init(fShapeList, ShapeDataList::Iter::kHead_IterStart);
35 while ((shapeData = iter.get())) {
43#ifdef DF_PATH_TRACKING
44 SkDebugf(
"Cached shapes: %d, freed shapes: %d\n", g_NumCachedShapes, g_NumFreedShapes);
55 static constexpr size_t kMaxAtlasTextureBytes = 2048 * 2048;
56 static constexpr size_t kPlotWidth = 512;
57 static constexpr size_t kPlotHeight = 256;
68 size.width(), size.height(),
69 kPlotWidth, kPlotHeight,
this,
79 fShapeList.
remove(shapeData);
84 auto shapeData = fShapeCache.
find(
key);
88 fShapeCache.
add(shapeData);
90#ifdef DF_PATH_TRACKING
93 }
else if (!fAtlas->hasID(shapeData->fAtlasLocator.plotLocator())) {
94 shapeData->fAtlasLocator.invalidatePlotLocator();
101 int desiredDimension) {
131 ShapeDataList::Iter iter;
132 iter.init(fShapeList, ShapeDataList::Iter::kHead_IterStart);
134 while ((shapeData = iter.get())) {
138 fShapeList.
remove(shapeData);
140#ifdef DF_PATH_TRACKING
static constexpr size_t GrColorTypeBytesPerPixel(GrColorType ct)
static constexpr SkColorType GrColorTypeToSkColorType(GrColorType ct)
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static constexpr bool SkToBool(const T &x)
int maxTextureSize() const
GrBackendFormat getDefaultBackendFormat(GrColorType, GrRenderable) const
SkISize atlasDimensions(skgpu::MaskFormat type) const
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)
T * find(const Key &key) const
void remove(const Key &key)
PlotLocator plotLocator() const
void deleteCacheEntry(SmallPathShapeData *)
bool initAtlas(GrProxyProvider *, const GrCaps *)
~SmallPathAtlasMgr() override
void evict(skgpu::PlotLocator) override
GrDrawOpAtlas::ErrorCode addToAtlas(GrResourceProvider *, GrDeferredUploadTarget *, int width, int height, const void *image, skgpu::AtlasLocator *)
void setUseToken(SmallPathShapeData *, skgpu::AtlasToken)
SmallPathShapeData * findOrCreate(const GrStyledShape &, int desiredDimension)
skgpu::AtlasLocator fAtlasLocator
const SmallPathShapeDataKey fKey
uint32_t uint32_t * format