#include "src/gpu/ganesh/GrDrawOpAtlas.h"
#include "include/core/SkRect.h"
#include "include/gpu/GpuTypes.h"
#include "include/gpu/ganesh/GrTypes.h"
#include "include/private/base/SkMath.h"
#include "include/private/base/SkPoint_impl.h"
#include "include/private/base/SkTArray.h"
#include "include/private/base/SkTPin.h"
#include "include/private/gpu/ganesh/GrTypesPriv.h"
#include "src/base/SkMathPriv.h"
#include "src/core/SkTraceEvent.h"
#include "src/gpu/SkBackingFit.h"
#include "src/gpu/Swizzle.h"
#include "src/gpu/ganesh/GrBackendUtils.h"
#include "src/gpu/ganesh/GrCaps.h"
#include "src/gpu/ganesh/GrProxyProvider.h"
#include "src/gpu/ganesh/GrSurfaceProxy.h"
#include "src/gpu/ganesh/GrTextureProxy.h"
#include <algorithm>
#include <functional>
#include <memory>
#include <tuple>
#include <utility>
usingnamespaceskia_private;
AtlasLocator;
AtlasToken;
EvictionCallback;
GenerationCounter;
MaskFormat;
Plot;
PlotList;
PlotLocator;
#if defined(DUMP_ATLAS_DATA)
static const constexpr bool kDumpAtlasData = true;
#else
static const constexpr bool kDumpAtlasData = …;
#endif
#ifdef SK_DEBUG
void GrDrawOpAtlas::validate(const AtlasLocator& atlasLocator) const { … }
#endif
void GrDrawOpAtlas::instantiate(GrOnFlushResourceProvider* onFlushResourceProvider) { … }
std::unique_ptr<GrDrawOpAtlas> GrDrawOpAtlas::Make(GrProxyProvider* proxyProvider,
const GrBackendFormat& format,
SkColorType colorType, size_t bpp, int width,
int height, int plotWidth, int plotHeight,
GenerationCounter* generationCounter,
AllowMultitexturing allowMultitexturing,
EvictionCallback* evictor,
std::string_view label) { … }
GrDrawOpAtlas::GrDrawOpAtlas(GrProxyProvider* proxyProvider, const GrBackendFormat& format,
SkColorType colorType, size_t bpp, int width, int height,
int plotWidth, int plotHeight, GenerationCounter* generationCounter,
AllowMultitexturing allowMultitexturing, std::string_view label)
: … { … }
inline void GrDrawOpAtlas::processEviction(PlotLocator plotLocator) { … }
void GrDrawOpAtlas::uploadPlotToTexture(GrDeferredTextureUploadWritePixelsFn& writePixels,
GrTextureProxy* proxy,
Plot* plot) { … }
inline bool GrDrawOpAtlas::updatePlot(GrDeferredUploadTarget* target,
AtlasLocator* atlasLocator, Plot* plot) { … }
bool GrDrawOpAtlas::uploadToPage(unsigned int pageIdx, GrDeferredUploadTarget* target, int width,
int height, const void* image, AtlasLocator* atlasLocator) { … }
static constexpr auto kPlotRecentlyUsedCount = …;
static constexpr auto kAtlasRecentlyUsedCount = …;
GrDrawOpAtlas::ErrorCode GrDrawOpAtlas::addToAtlas(GrResourceProvider* resourceProvider,
GrDeferredUploadTarget* target,
int width, int height, const void* image,
AtlasLocator* atlasLocator) { … }
void GrDrawOpAtlas::compact(AtlasToken startTokenForNextFlush) { … }
bool GrDrawOpAtlas::createPages(
GrProxyProvider* proxyProvider, GenerationCounter* generationCounter) { … }
bool GrDrawOpAtlas::activateNewPage(GrResourceProvider* resourceProvider) { … }
inline void GrDrawOpAtlas::deactivateLastPage() { … }
GrDrawOpAtlasConfig::GrDrawOpAtlasConfig(int maxTextureSize, size_t maxBytes) { … }
SkISize GrDrawOpAtlasConfig::atlasDimensions(MaskFormat type) const { … }
SkISize GrDrawOpAtlasConfig::plotDimensions(MaskFormat type) const { … }