src/java.desktop/macosx/native/libawt_lwawt/awt/AWTSurfaceLayers.m
branchmetal-prototype-branch
changeset 57196 a95707a39ff5
parent 47216 71c04702a3d5
child 57417 28582d575a98
--- a/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTSurfaceLayers.m	Tue Feb 19 17:16:15 2019 +0530
+++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTSurfaceLayers.m	Wed Feb 20 17:00:40 2019 +0530
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,7 @@
 
 #import <JavaNativeFoundation/JavaNativeFoundation.h>
 #import <QuartzCore/CATransaction.h>
+#import <QuartzCore/CAMetalLayer.h>
 
 @implementation AWTSurfaceLayers
 
@@ -69,8 +70,10 @@
 
 // Updates back buffer size of the layer if it's an OpenGL layer
 // including all OpenGL sublayers
+// TODO : Added check for CAMetalLayer also but this needs to be verified.
 + (void) repaintLayersRecursively:(CALayer*)aLayer {
-    if ([aLayer isKindOfClass:[CAOpenGLLayer class]]) {
+    if ([aLayer isKindOfClass:[CAOpenGLLayer class]] ||
+        [aLayer isKindOfClass:[CAMetalLayer class]]) {
         [aLayer setNeedsDisplay];
     }
     for(CALayer *child in aLayer.sublayers) {
@@ -92,7 +95,7 @@
 
 /*
  * Class:     sun_lwawt_macosx_CPlatformComponent
- * Method:    nativeCreateLayer
+ * Method:    nativeCreateComponent
  * Signature: ()J
  */
 JNIEXPORT jlong JNICALL