< prev index next >

src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLLayer.m

Print this page




  54     //Disable CALayer's default animation
  55     NSMutableDictionary * actions = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
  56                                     [NSNull null], @"anchorPoint",
  57                                     [NSNull null], @"bounds",
  58                                     [NSNull null], @"contents",
  59                                     [NSNull null], @"contentsScale",
  60                                     [NSNull null], @"onOrderIn",
  61                                     [NSNull null], @"onOrderOut",
  62                                     [NSNull null], @"position",
  63                                     [NSNull null], @"sublayers",
  64                                     nil];
  65     self.actions = actions;
  66     [actions release];
  67 
  68 
  69     return self;
  70 }
  71 
  72 - (void) blitTexture:(id<MTLCommandBuffer>)commandBuf {
  73     if (self.ctx == NULL || self.javaLayer == NULL || self.buffer == nil || ctx.device == nil) {
  74         J2dTraceLn4(J2D_TRACE_VERBOSE, "MTLLayer.blitTexture: uninitialized (mtlc=%p, javaLayer=%p, buffer=%p, devide=%p)", self.ctx, self.javaLayer, self.buffer, ctx->mtlDevice);
  75         return;
  76     }
  77 
  78     if (commandBuf == nil) {
  79         J2dTraceLn(J2D_TRACE_VERBOSE, "MTLLayer.blitTexture: nothing to do (commandBuf is null)");
  80         return;
  81     }
  82 
  83     @autoreleasepool {
  84         self.device = ctx.device;
  85         self.pixelFormat = MTLPixelFormatBGRA8Unorm;
  86         self.framebufferOnly = NO;
  87 
  88         self.drawableSize =
  89             CGSizeMake(self.buffer.width,
  90                        self.buffer.height);
  91 
  92         id<CAMetalDrawable> mtlDrawable = [self nextDrawable];
  93         if (mtlDrawable == nil) {
  94             return;




  54     //Disable CALayer's default animation
  55     NSMutableDictionary * actions = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
  56                                     [NSNull null], @"anchorPoint",
  57                                     [NSNull null], @"bounds",
  58                                     [NSNull null], @"contents",
  59                                     [NSNull null], @"contentsScale",
  60                                     [NSNull null], @"onOrderIn",
  61                                     [NSNull null], @"onOrderOut",
  62                                     [NSNull null], @"position",
  63                                     [NSNull null], @"sublayers",
  64                                     nil];
  65     self.actions = actions;
  66     [actions release];
  67 
  68 
  69     return self;
  70 }
  71 
  72 - (void) blitTexture:(id<MTLCommandBuffer>)commandBuf {
  73     if (self.ctx == NULL || self.javaLayer == NULL || self.buffer == nil || ctx.device == nil) {
  74         J2dTraceLn4(J2D_TRACE_VERBOSE, "MTLLayer.blitTexture: uninitialized (mtlc=%p, javaLayer=%p, buffer=%p, devide=%p)", self.ctx, self.javaLayer, self.buffer, ctx.device);
  75         return;
  76     }
  77 
  78     if (commandBuf == nil) {
  79         J2dTraceLn(J2D_TRACE_VERBOSE, "MTLLayer.blitTexture: nothing to do (commandBuf is null)");
  80         return;
  81     }
  82 
  83     @autoreleasepool {
  84         self.device = ctx.device;
  85         self.pixelFormat = MTLPixelFormatBGRA8Unorm;
  86         self.framebufferOnly = NO;
  87 
  88         self.drawableSize =
  89             CGSizeMake(self.buffer.width,
  90                        self.buffer.height);
  91 
  92         id<CAMetalDrawable> mtlDrawable = [self nextDrawable];
  93         if (mtlDrawable == nil) {
  94             return;


< prev index next >