41 CAMetalLayer* metalLayer = (__bridge CAMetalLayer*)layer;
46 SkISize dims = {(
int)metalLayer.drawableSize.
width, (
int)metalLayer.drawableSize.height};
55 CAMetalLayer* metalLayer = (__bridge CAMetalLayer*)layer;
56 id<CAMetalDrawable> currentDrawable = [metalLayer nextDrawable];
60 if (metalLayer.framebufferOnly) {
62 mtlGpu, desc.fDimensions, desc.fSampleCnt, currentDrawable.texture);
68 currentDrawable.texture,
71 if (
surface && desc.fSampleCnt > 1) {
72 surface->setRequiresManualMSAAResolve();
75 *drawable = (__bridge_retained
GrMTLHandle)currentDrawable;
83 metalLayer.framebufferOnly ? nullptr : &texInfo,
93 std::move(colorSpace),
101 return sk_make_sp<SkSurface_Ganesh>(std::move(
device));
113 MTKView* mtkView = (__bridge MTKView*)view;
118 SkISize dims = {(
int)mtkView.drawableSize.
width, (
int)mtkView.drawableSize.height};
127 MTKView* mtkView = (__bridge MTKView*)view;
128 id<CAMetalDrawable> currentDrawable = [mtkView currentDrawable];
132 if (mtkView.framebufferOnly) {
134 mtlGpu, desc.fDimensions, desc.fSampleCnt, currentDrawable.texture);
140 currentDrawable.texture,
143 if (
surface && desc.fSampleCnt > 1) {
144 surface->setRequiresManualMSAAResolve();
154 mtkView.framebufferOnly ? nullptr : &texInfo,
164 std::move(colorSpace),
172 return sk_make_sp<SkSurface_Ganesh>(std::move(
device));
static sk_sp< GrMtlTextureRenderTarget > MakeWrappedTextureRenderTarget(GrMtlGpu *, SkISize, int sampleCnt, id< MTLTexture >, GrWrapCacheable)
sk_sp< GrRenderTargetProxy > createLazyRenderTargetProxy(LazyInstantiateCallback &&, const GrBackendFormat &, SkISize dimensions, int renderTargetSampleCnt, GrInternalSurfaceFlags, const TextureInfo *, GrMipmapStatus, SkBackingFit, skgpu::Budgeted, GrProtected, bool wrapsVkSecondaryCB, UseAllocator useAllocator)
GrProxyProvider * proxyProvider()
sk_sp< skgpu::ganesh::Device > createDevice(GrColorType, sk_sp< GrSurfaceProxy >, sk_sp< SkColorSpace >, GrSurfaceOrigin, const SkSurfaceProps &, skgpu::ganesh::Device::InitContents)
GrRecordingContextPriv priv()
SK_API sk_sp< SkSurface > WrapCAMetalLayer(GrRecordingContext *context, GrMTLHandle layer, GrSurfaceOrigin origin, int sampleCnt, SkColorType colorType, sk_sp< SkColorSpace > colorSpace, const SkSurfaceProps *surfaceProps, GrMTLHandle *drawable) SK_API_AVAILABLE_CA_METAL_LAYER
SK_API sk_sp< SkSurface > WrapMTKView(GrRecordingContext *context, GrMTLHandle mtkView, GrSurfaceOrigin origin, int sampleCnt, SkColorType colorType, sk_sp< SkColorSpace > colorSpace, const SkSurfaceProps *surfaceProps) SK_API_AVAILABLE(macos(10.11)
GrTextureType fTextureType
skgpu::Mipmapped fMipmapped