From 06fd7471c47b291c713f9ec7d7d7c4a143ebbd8f Mon Sep 17 00:00:00 2001 From: Jeremy Powell Date: Fri, 22 Aug 2025 10:27:00 +1200 Subject: [PATCH] Update to new GrDirectContext::MakeMetal API Also, use retain for setting the pointers to prevent GrMtlBackendContext from disposing the command queue. --- src/gpu/ganesh/GrDirectContext.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gpu/ganesh/GrDirectContext.cpp b/src/gpu/ganesh/GrDirectContext.cpp index 8258b7684ef8..8e1f76cef8c9 100644 --- a/src/gpu/ganesh/GrDirectContext.cpp +++ b/src/gpu/ganesh/GrDirectContext.cpp @@ -1235,10 +1235,9 @@ sk_sp GrDirectContext::MakeMetal(void* device, void* queue) { // remove include/gpu/mtl/GrMtlBackendContext.h, above, when removed sk_sp GrDirectContext::MakeMetal(void* device, void* queue, const GrContextOptions& options) { - sk_sp direct(new GrDirectContext(GrBackendApi::kMetal, options)); GrMtlBackendContext backendContext = {}; - backendContext.fDevice.reset(device); - backendContext.fQueue.reset(queue); + backendContext.fDevice.retain(device); + backendContext.fQueue.retain(queue); return GrDirectContext::MakeMetal(backendContext, options); }