Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8267602: [macos] [lanai] java/awt/PrintJob/Text/stringwidth.sh doesn'…
…t exit on cancelling print dialog

Reviewed-by: aghaisas, serb
  • Loading branch information
jayathirthrao committed Jul 1, 2021
1 parent 4930ae9 commit f7ffd5872d69633c89505ce3e4fef9df8293e76b
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLLayer.m
@@ -80,6 +80,7 @@ - (id) initWithJavaLayer:(jobject)layer
- (void) blitTexture {
if (self.ctx == NULL || self.javaLayer == NULL || self.buffer == nil || self.ctx.device == nil) {
J2dTraceLn4(J2D_TRACE_VERBOSE, "MTLLayer.blitTexture: uninitialized (mtlc=%p, javaLayer=%p, buffer=%p, devide=%p)", self.ctx, self.javaLayer, self.buffer, ctx.device);
[self stopDisplayLink];
return;
}

@@ -89,6 +90,7 @@ - (void) blitTexture {
@autoreleasepool {
if ((self.buffer.width == 0) || (self.buffer.height == 0)) {
J2dTraceLn(J2D_TRACE_VERBOSE, "MTLLayer.blitTexture: cannot create drawable of size 0");
[self stopDisplayLink];
return;
}

@@ -99,17 +101,20 @@ - (void) blitTexture {

if (src_h <= 0 || src_w <= 0) {
J2dTraceLn(J2D_TRACE_VERBOSE, "MTLLayer.blitTexture: Invalid src width or height.");
[self stopDisplayLink];
return;
}

id<MTLCommandBuffer> commandBuf = [self.ctx createBlitCommandBuffer];
if (commandBuf == nil) {
J2dTraceLn(J2D_TRACE_VERBOSE, "MTLLayer.blitTexture: commandBuf is null");
[self stopDisplayLink];
return;
}
id<CAMetalDrawable> mtlDrawable = [self nextDrawable];
if (mtlDrawable == nil) {
J2dTraceLn(J2D_TRACE_VERBOSE, "MTLLayer.blitTexture: nextDrawable is null)");
[self stopDisplayLink];
return;
}
self.nextDrawableCount++;
@@ -277,6 +282,7 @@ CVReturn displayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeStamp* no
MTLContext * ctx = layer.ctx;
if (layer == NULL || ctx == NULL) {
J2dTraceLn(J2D_TRACE_VERBOSE, "MTLLayer_blit : Layer or Context is null");
[layer stopDisplayLink];
return;
}

1 comment on commit f7ffd58

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on f7ffd58 Jul 1, 2021

Please sign in to comment.