From 20afd0e351417b726ebcc638cefd45cb76292362 Mon Sep 17 00:00:00 2001 From: Sergey Bylokhov Date: Wed, 8 May 2013 15:58:30 +0400 Subject: [PATCH] 8013841: [macosx] Animations not disabled for CALayers used via JAWT Reviewed-by: anthony, alexsch --- jdk/src/macosx/native/sun/awt/AWTSurfaceLayers.m | 15 +++++++-------- .../macosx/native/sun/java2d/opengl/CGLLayer.m | 4 +++- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/jdk/src/macosx/native/sun/awt/AWTSurfaceLayers.m b/jdk/src/macosx/native/sun/awt/AWTSurfaceLayers.m index 6e9fbbca5ab..d12908c83a3 100644 --- a/jdk/src/macosx/native/sun/awt/AWTSurfaceLayers.m +++ b/jdk/src/macosx/native/sun/awt/AWTSurfaceLayers.m @@ -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 +#import @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]; } diff --git a/jdk/src/macosx/native/sun/java2d/opengl/CGLLayer.m b/jdk/src/macosx/native/sun/java2d/opengl/CGLLayer.m index e0074eb4ef3..f300ea404c4 100644 --- a/jdk/src/macosx/native/sun/java2d/opengl/CGLLayer.m +++ b/jdk/src/macosx/native/sun/java2d/opengl/CGLLayer.m @@ -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 @@ AWT_ASSERT_APPKIT_THREAD; //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;