8013841: [macosx] Animations not disabled for CALayers used via JAWT
authorserb
Wed, 08 May 2013 15:58:30 +0400
changeset 17411 6a6136a94ebb
parent 17410 c9c726c5ce7e
child 17412 b86174090afd
8013841: [macosx] Animations not disabled for CALayers used via JAWT Reviewed-by: anthony, alexsch
jdk/src/macosx/native/sun/awt/AWTSurfaceLayers.m
jdk/src/macosx/native/sun/java2d/opengl/CGLLayer.m
--- a/jdk/src/macosx/native/sun/awt/AWTSurfaceLayers.m	Mon May 06 16:23:36 2013 +0400
+++ b/jdk/src/macosx/native/sun/awt/AWTSurfaceLayers.m	Wed May 08 15:58:30 2013 +0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2013, 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
@@ -28,6 +28,7 @@
 #import "LWCToolkit.h"
 
 #import <JavaNativeFoundation/JavaNativeFoundation.h>
+#import <QuartzCore/CATransaction.h>
 
 @implementation AWTSurfaceLayers
 
@@ -74,14 +75,12 @@
 }
 
 - (void) setBounds:(CGRect)rect {
-    layer.anchorPoint = CGPointMake(0, 0);
-
     // translates values to the coordinate system of the "root" layer
-    CGFloat newY = windowLayer.bounds.size.height - rect.origin.y - rect.size.height;
-    CGRect newRect = CGRectMake(rect.origin.x, newY, rect.size.width, rect.size.height);
-
-    layer.frame = newRect;
-
+    rect.origin.y = windowLayer.bounds.size.height - rect.origin.y - rect.size.height;
+    [CATransaction begin];
+    [CATransaction setDisableActions:YES];
+    layer.frame = rect;
+    [CATransaction commit];
     [AWTSurfaceLayers repaintLayersRecursively:layer];
 }
 
--- a/jdk/src/macosx/native/sun/java2d/opengl/CGLLayer.m	Mon May 06 16:23:36 2013 +0400
+++ b/jdk/src/macosx/native/sun/java2d/opengl/CGLLayer.m	Wed May 08 15:58:30 2013 +0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2013, 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
@@ -64,11 +64,13 @@
 
     //Disable CALayer's default animation
     NSMutableDictionary * actions = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
+                                    [NSNull null], @"anchorPoint",
                                     [NSNull null], @"bounds",
                                     [NSNull null], @"contents",
                                     [NSNull null], @"contentsScale",
                                     [NSNull null], @"onOrderIn",
                                     [NSNull null], @"onOrderOut",
+                                    [NSNull null], @"position",
                                     [NSNull null], @"sublayers",
                                     nil];
     self.actions = actions;