Here is my code:
surface1 :
GrDirectContext* fGrContext = GrDirectContext::MakeMetal(metaldevice,metalqueue,grContextOptions).release();
auto surface1 = SkSurface::MakeRenderTarget(fGrContext, skgpu::Budgeted::kNo, imgInfo)
....after drawing
sk_sp<SkImage> image = surface1->makeImageSnapshot();
image = image->makeRasterImage();
surface2:
auto context = GrDirectContext::MakeMetal((__bridge void*)_mtDevice,(void*)CFBridgingRetain(_mtQueue), grContextOptions).release();
std::shared_ptr<GrContextHolder> fGrContext = std::make_shared<GrContextHolder(std::move(context));
sk_sp<SkSurface> surface2 = SkSurface::MakeFromMTKView(fGrContext->get(), (__bridge GrMTLHandle)metalView, origin, sampleCount, colorType, colorSpace, &surfaceProps);
auto canvas = surface2->getCanvas();
canvas->drawImage(image);
--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/c3b3f5f9-b7ab-423f-899a-cfee747bca04n%40googlegroups.com.