263 {
264 using namespace skgpu;
265
266 auto direct = ctxInfo.directContext();
269 GrGpu* gpu = direct->priv().getGpu();
270 const GrCaps& caps = *direct->priv().caps();
271
273
275
279
280
281
282
283
284 if (direct->colorTypeSupportedAsSurface(
colorType)) {
290 static constexpr int kExpectedNumSamples = 1;
294 gpu->deleteTestingOnlyBackendRenderTarget(backendRT);
295 }
296
297 for (auto numSamples : {1, 4}) {
300 if (!supportedNumSamples) {
301 continue;
302 }
303
304#ifdef SK_GL
305
306
313 static constexpr int kStencilBits = 8;
322 }
323#endif
324
325
326 {
327 auto mbet =
328 sk_gpu_test::ManagedBackendTexture::MakeWithoutData(direct,
334 isProtected);
335 if (!mbet) {
337 "Could not create renderable backend texture of color type %d",
339 continue;
340 }
344 if (!sProxy) {
346 continue;
347 }
348
354 }
355
356 {
357
358 auto mbet =
359 sk_gpu_test::ManagedBackendTexture::MakeWithoutData(direct,
365 isProtected);
366 if (!mbet) {
368 "Could not create non-renderable backend texture of color type %d",
370 continue;
371 }
375 if (!sProxy) {
377 continue;
378 }
379
384 }
385 }
386 }
387}
@ kBorrow_GrWrapOwnership
static constexpr GrColorType SkColorTypeToGrColorType(SkColorType ct)
static const int kWidthHeight
@ kAlpha_8_SkColorType
pixel with alpha in 8-bit byte
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
@ kRGBA_1010102_SkColorType
10 bits for red, green, blue; 2 bits for alpha; in 32-bit word
static SkColorType colorType(AImageDecoder *decoder, const AImageDecoderHeaderInfo *headerInfo)
sk_sp< GrTextureProxy > wrapBackendTexture(const GrBackendTexture &, GrWrapOwnership, GrWrapCacheable, GrIOType, sk_sp< skgpu::RefCntedCallback >=nullptr)
sk_sp< GrTextureProxy > wrapRenderableBackendTexture(const GrBackendTexture &, int sampleCnt, GrWrapOwnership, GrWrapCacheable, sk_sp< skgpu::RefCntedCallback > releaseHelper)
sk_sp< GrSurfaceProxy > wrapBackendRenderTarget(const GrBackendRenderTarget &, sk_sp< skgpu::RefCntedCallback > releaseHelper)
virtual GrTextureProxy * asTextureProxy()
SK_API GrBackendRenderTarget MakeGL(int width, int height, int sampleCnt, int stencilBits, const GrGLFramebufferInfo &glInfo)
skgpu::Protected fProtected