#include "src/gpu/graphite/DrawAtlas.h"
#include <memory>
#include "include/core/SkColorSpace.h"
#include "include/core/SkStream.h"
#include "include/gpu/graphite/Recorder.h"
#include "include/private/SkColorData.h"
#include "include/private/base/SkTPin.h"
#include "src/base/SkMathPriv.h"
#include "src/core/SkTraceEvent.h"
#include "src/gpu/AtlasTypes.h"
#include "src/gpu/graphite/Caps.h"
#include "src/gpu/graphite/CommandTypes.h"
#include "src/gpu/graphite/ContextPriv.h"
#include "src/gpu/graphite/DrawContext.h"
#include "src/gpu/graphite/RecorderPriv.h"
#include "src/gpu/graphite/TextureProxy.h"
usingnamespaceskia_private;
namespace skgpu::graphite {
#if defined(DUMP_ATLAS_DATA)
static const constexpr bool kDumpAtlasData = true;
#else
static const constexpr bool kDumpAtlasData = …;
#endif
#ifdef SK_DEBUG
void DrawAtlas::validate(const AtlasLocator& atlasLocator) const { … }
#endif
std::unique_ptr<DrawAtlas> DrawAtlas::Make(SkColorType colorType, size_t bpp, int width,
int height, int plotWidth, int plotHeight,
AtlasGenerationCounter* generationCounter,
AllowMultitexturing allowMultitexturing,
UseStorageTextures useStorageTextures,
PlotEvictionCallback* evictor,
std::string_view label) { … }
static uint32_t next_id() { … }
DrawAtlas::DrawAtlas(SkColorType colorType, size_t bpp, int width, int height,
int plotWidth, int plotHeight, AtlasGenerationCounter* generationCounter,
AllowMultitexturing allowMultitexturing,
UseStorageTextures useStorageTextures,
std::string_view label)
: … { … }
inline void DrawAtlas::processEviction(PlotLocator plotLocator) { … }
inline void DrawAtlas::updatePlot(Plot* plot, AtlasLocator* atlasLocator) { … }
bool DrawAtlas::addRectToPage(unsigned int pageIdx, int width, int height,
AtlasLocator* atlasLocator) { … }
bool DrawAtlas::recordUploads(DrawContext* dc, Recorder* recorder) { … }
static constexpr auto kPlotRecentlyUsedCount = …;
static constexpr auto kAtlasRecentlyUsedCount = …;
DrawAtlas::ErrorCode DrawAtlas::addRect(Recorder* recorder,
int width, int height,
AtlasLocator* atlasLocator) { … }
DrawAtlas::ErrorCode DrawAtlas::addToAtlas(Recorder* recorder,
int width, int height, const void* image,
AtlasLocator* atlasLocator) { … }
SkIPoint DrawAtlas::prepForRender(const AtlasLocator& locator, SkAutoPixmapStorage* pixmap) { … }
void DrawAtlas::compact(AtlasToken startTokenForNextFlush) { … }
void DrawAtlas::purge(AtlasToken startTokenForNextFlush) { … }
bool DrawAtlas::createPages(AtlasGenerationCounter* generationCounter) { … }
bool DrawAtlas::activateNewPage(Recorder* recorder) { … }
inline void DrawAtlas::deactivateLastPage() { … }
void DrawAtlas::markUsedPlotsAsFull() { … }
void DrawAtlas::evictAllPlots() { … }
DrawAtlasConfig::DrawAtlasConfig(int maxTextureSize, size_t maxBytes) { … }
SkISize DrawAtlasConfig::atlasDimensions(MaskFormat type) const { … }
SkISize DrawAtlasConfig::plotDimensions(MaskFormat type) const { … }
}