Skip to content

Commit 06fd747

Browse files
jeremy-visionaidmattleibow
authored andcommitted
Update to new GrDirectContext::MakeMetal API
Also, use retain for setting the pointers to prevent GrMtlBackendContext from disposing the command queue.
1 parent d8d50cf commit 06fd747

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/gpu/ganesh/GrDirectContext.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,10 +1235,9 @@ sk_sp<GrDirectContext> GrDirectContext::MakeMetal(void* device, void* queue) {
12351235
// remove include/gpu/mtl/GrMtlBackendContext.h, above, when removed
12361236
sk_sp<GrDirectContext> GrDirectContext::MakeMetal(void* device, void* queue,
12371237
const GrContextOptions& options) {
1238-
sk_sp<GrDirectContext> direct(new GrDirectContext(GrBackendApi::kMetal, options));
12391238
GrMtlBackendContext backendContext = {};
1240-
backendContext.fDevice.reset(device);
1241-
backendContext.fQueue.reset(queue);
1239+
backendContext.fDevice.retain(device);
1240+
backendContext.fQueue.retain(queue);
12421241

12431242
return GrDirectContext::MakeMetal(backendContext, options);
12441243
}

0 commit comments

Comments
 (0)