21 {
22 if (@available(macOS 11.0, iOS 9.0, tvOS 9.0, *)) {
23 static const int kWidth = 1024;
25
26 auto context = ctxInfo.directContext();
27
28
30
33 id<CAMetalDrawable> drawable = [view currentDrawable];
36
37
39
40
41 GrMtlTextureInfo fbInfo;
42 fbInfo.fTexture.retain((__bridge const void*)(drawable.texture));
44
47
49 srcProxy,
54 {});
55
56
57
58 if (!dstProxy) {
60 }
61
62
66 backendFormat,
69 1,
73 "MtlCopySurfaceTest");
74
81 }
82}
@ kTopLeft_GrSurfaceOrigin
#define REPORTER_ASSERT(r, cond,...)
bool copySurface(GrSurface *dst, const SkIRect &dstRect, GrSurface *src, const SkIRect &srcRect, GrSamplerState::Filter filter)
sk_sp< GrTexture > createTexture(SkISize dimensions, const GrBackendFormat &format, GrTextureType textureType, GrRenderable renderable, int renderTargetSampleCnt, skgpu::Budgeted budgeted, GrProtected isProtected, GrColorType textureColorType, GrColorType srcColorType, const GrMipLevel texels[], int texelLevelCount, std::string_view label)
id< MTLDevice > device() const
sk_sp< GrSurfaceProxy > wrapBackendRenderTarget(const GrBackendRenderTarget &, sk_sp< skgpu::RefCntedCallback > releaseHelper)
static sk_sp< GrSurfaceProxy > Copy(GrRecordingContext *, sk_sp< GrSurfaceProxy > src, GrSurfaceOrigin, skgpu::Mipmapped, SkIRect srcRect, SkBackingFit, skgpu::Budgeted, std::string_view label, RectsMustMatch=RectsMustMatch::kNo, sk_sp< GrRenderTask > *outTask=nullptr)
GrSurface * peekSurface() const
instancetype initWithFrame
SK_API GrBackendRenderTarget MakeMtl(int width, int height, const GrMtlTextureInfo &mtlInfo)
static constexpr SkIRect MakeWH(int32_t w, int32_t h)