diff --git a/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLLayer.m b/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLLayer.m index 989a93d24e8f..11fe76efe47f 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLLayer.m +++ b/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLLayer.m @@ -73,9 +73,10 @@ - (id) initWithJavaLayer:(jobject)layer [actions release]; self.topInset = 0; self.leftInset = 0; - self.framebufferOnly = NO; + self.framebufferOnly = YES; self.nextDrawableCount = 0; self.opaque = YES; + self.presentsWithTransaction = YES; if (isDisplaySyncEnabled()) { CVDisplayLinkCreateWithActiveCGDisplays(&_displayLink); CVDisplayLinkSetOutputCallback(_displayLink, &displayLinkCallback, (__bridge void *) self); @@ -143,7 +144,6 @@ - (void) blitTexture { destinationOrigin:MTLOriginMake(0, 0, 0)]; [blitEncoder endEncoding]; - [commandBuf presentDrawable:mtlDrawable]; __block MTLLayer* layer = self; [layer retain]; [commandBuf addCompletedHandler:^(id commandBuf) { @@ -152,6 +152,8 @@ - (void) blitTexture { }]; [commandBuf commit]; + [commandBuf waitUntilScheduled]; + [mtlDrawable present]; } }