67 uint32_t expectedActive, uint32_t expectedMax,
int expectedAlloced) {
106 data.allocPixels(ii);
107 data.eraseARGB(alpha, 0, 0, 0);
111 data.getAddr(0, 0), atlasLocator);
122 auto context = ctxInfo.directContext();
123 auto proxyProvider = context->priv().proxyProvider();
124 auto resourceProvider = context->priv().resourceProvider();
125 auto drawingManager = context->priv().drawingManager();
126 const GrCaps* caps = context->priv().caps();
148 "BasicDrawOpAtlasTest");
155 atlas.
get(), resourceProvider, &uploadTarget, &atlasLocators[
i],
i * 32);
160 atlas->instantiate(&onFlushResourceProvider);
170 for (
int i = 0;
i < 512; ++
i) {
186 auto dContext = ctxInfo.directContext();
188 auto gpu = dContext->priv().getGpu();
189 auto resourceProvider = dContext->priv().resourceProvider();
197 "AtlasTextOpPreparation");
205 const char*
text =
"a";
231 auto atlasManager = dContext->priv().getAtlasManager();
232 unsigned int numProxies;
233 atlasManager->getViews(MaskFormat::kA8, &numProxies);
237 op->prepare(&flushState);
243 SkISize expectedPlotDimensions) {
252 { 256, 256 }, { 256, 256 });
254 { 512, 512 }, { 256, 256 });
257 { 512, 256 }, { 256, 256 });
259 { 1024, 512 }, { 256, 256 });
262 { 512, 512 }, { 256, 256 });
264 { 1024, 1024 }, { 256, 256 });
267 { 1024, 512 }, { 256, 256 });
269 { 2048, 1024 }, { 512, 256 });
272 { 1024, 1024 }, { 256, 256 });
274 { 2048, 2048 }, { 512, 512 });
277 { 2048, 1024 }, { 256, 256 });
279 { 2048, 2048 }, { 512, 512 });
282 { 2048, 1024 }, { 256, 256 });
284 { 2048, 2048 }, { 512, 512 });
288 { 1024, 1024 }, { 256, 256 });
290 { 1024, 1024 }, { 256, 256 });
294 { 1024, 512 }, { 256, 256 });
296 { 2048, 1024 }, { 512, 256 });
300 { 256, 256 }, { 256, 256 });
302 { 512, 512 }, { 256, 256 });
static void check(skiatest::Reporter *r, GrDrawOpAtlas *atlas, uint32_t expectedActive, uint32_t expectedMax, int expectedAlloced)
DEF_GANESH_TEST_FOR_RENDERING_CONTEXTS(BasicDrawOpAtlas, reporter, ctxInfo, CtsEnforcement::kApiLevel_T)
static const int kAtlasSize
static const int kNumPlots
void test_atlas_config(skiatest::Reporter *reporter, int maxTextureSize, size_t maxBytes, MaskFormat maskFormat, SkISize expectedDimensions, SkISize expectedPlotDimensions)
static const int kPlotSize
static bool fill_plot(GrDrawOpAtlas *atlas, GrResourceProvider *resourceProvider, GrDeferredUploadTarget *target, skgpu::AtlasLocator *atlasLocator, int alpha)
DEF_GANESH_TEST(GrDrawOpAtlasConfig_Basic, reporter, options, CtsEnforcement::kApiLevel_T)
std::function< void(GrDeferredTextureUploadWritePixelsFn &)> GrDeferredTextureUploadFn
static constexpr size_t GrColorTypeBytesPerPixel(GrColorType ct)
static constexpr SkColorType GrColorTypeToSkColorType(GrColorType ct)
constexpr SkColor SK_ColorRED
#define REPORTER_ASSERT(r, cond,...)
void evict(skgpu::PlotLocator) override
GrBackendFormat getDefaultBackendFormat(GrColorType, GrRenderable) const
SkISize atlasDimensions(skgpu::MaskFormat type) const
SkISize plotDimensions(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)
void setOpArgs(OpArgs *opArgs)
std::unique_ptr< GrOp > Owner
@ kAlias
no transparent pixels on glyph edges
static const SkMatrix & I()
skgpu::AtlasToken addASAPUpload(GrDeferredTextureUploadFn &&upload) final
const skgpu::TokenTracker * tokenTracker() final
skgpu::AtlasToken addInlineUpload(GrDeferredTextureUploadFn &&) final
skgpu::TokenTracker * writeableTokenTracker()
AtlasToken nextFlushToken() const
AtlasToken nextDrawToken() const
static std::unique_ptr< SurfaceDrawContext > Make(GrRecordingContext *, GrColorType, sk_sp< GrSurfaceProxy >, sk_sp< SkColorSpace >, GrSurfaceOrigin, const SkSurfaceProps &)
uint32_t uint32_t * format
sk_sp< const SkImage > atlas
font
Font Metadata and Metrics.
static SkImageInfo MakeA8(int width, int height)
std::shared_ptr< const fml::Mapping > data