18#import <Metal/Metal.h>
19#import <MetalKit/MTKView.h>
22 if (@available(macOS 11.0, iOS 9.0, tvOS 9.0, *)) {
23 static const int kWidth = 1024;
26 auto context = ctxInfo.directContext();
33 id<CAMetalDrawable> drawable = [view currentDrawable];
41 GrMtlTextureInfo fbInfo;
42 fbInfo.fTexture.retain((__bridge
const void*)(drawable.texture));
73 "MtlCopySurfaceTest");
@ kTopLeft_GrSurfaceOrigin
DEF_GANESH_TEST_FOR_METAL_CONTEXT(MtlCopySurfaceTest, reporter, ctxInfo)
#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)