Fix MetalWindowContext setup.
Previous changes fixed the zombie device and queue, assuming that they're bridged correctly. Bug: skia:8243 Change-Id: Id4c2d10beacbb2ac749187d8d54fc2d276cf7b3d Reviewed-on: https://skia-review.googlesource.com/c/skia/+/219378 Auto-Submit: Jim Van Verth <jvanverth@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
This commit is contained in:
parent
de832b9f29
commit
6e4fee8c81
@ -49,7 +49,8 @@ void MetalWindowContext::initializeContext() {
|
|||||||
|
|
||||||
fValid = this->onInitializeContext();
|
fValid = this->onInitializeContext();
|
||||||
|
|
||||||
fContext = GrContext::MakeMetal(fDevice, fQueue, fDisplayParams.fGrContextOptions);
|
fContext = GrContext::MakeMetal((__bridge void*)fDevice, (__bridge void*)fQueue,
|
||||||
|
fDisplayParams.fGrContextOptions);
|
||||||
if (!fContext && fDisplayParams.fMSAASampleCount > 1) {
|
if (!fContext && fDisplayParams.fMSAASampleCount > 1) {
|
||||||
fDisplayParams.fMSAASampleCount /= 2;
|
fDisplayParams.fMSAASampleCount /= 2;
|
||||||
this->initializeContext();
|
this->initializeContext();
|
||||||
@ -69,9 +70,8 @@ void MetalWindowContext::destroyContext() {
|
|||||||
fMetalLayer = nil;
|
fMetalLayer = nil;
|
||||||
fValid = false;
|
fValid = false;
|
||||||
|
|
||||||
// TODO: figure out why we can't release these
|
[fQueue release];
|
||||||
// [fQueue release];
|
[fDevice release];
|
||||||
// [fDevice release];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sk_sp<SkSurface> MetalWindowContext::getBackbufferSurface() {
|
sk_sp<SkSurface> MetalWindowContext::getBackbufferSurface() {
|
||||||
|
Loading…
Reference in New Issue
Block a user