8013841: [macosx] Animations not disabled for CALayers used via JAWT

Reviewed-by: anthony, alexsch
This commit is contained in:
Sergey Bylokhov 2013-05-08 15:58:30 +04:00
parent c9775371ce
commit 20afd0e351
2 changed files with 10 additions and 9 deletions

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -28,6 +28,7 @@
#import "LWCToolkit.h" #import "LWCToolkit.h"
#import <JavaNativeFoundation/JavaNativeFoundation.h> #import <JavaNativeFoundation/JavaNativeFoundation.h>
#import <QuartzCore/CATransaction.h>
@implementation AWTSurfaceLayers @implementation AWTSurfaceLayers
@ -74,14 +75,12 @@
} }
- (void) setBounds:(CGRect)rect { - (void) setBounds:(CGRect)rect {
layer.anchorPoint = CGPointMake(0, 0);
// translates values to the coordinate system of the "root" layer // translates values to the coordinate system of the "root" layer
CGFloat newY = windowLayer.bounds.size.height - rect.origin.y - rect.size.height; rect.origin.y = windowLayer.bounds.size.height - rect.origin.y - rect.size.height;
CGRect newRect = CGRectMake(rect.origin.x, newY, rect.size.width, rect.size.height); [CATransaction begin];
[CATransaction setDisableActions:YES];
layer.frame = newRect; layer.frame = rect;
[CATransaction commit];
[AWTSurfaceLayers repaintLayersRecursively:layer]; [AWTSurfaceLayers repaintLayersRecursively:layer];
} }

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * 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 //Disable CALayer's default animation
NSMutableDictionary * actions = [[NSMutableDictionary alloc] initWithObjectsAndKeys: NSMutableDictionary * actions = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
[NSNull null], @"anchorPoint",
[NSNull null], @"bounds", [NSNull null], @"bounds",
[NSNull null], @"contents", [NSNull null], @"contents",
[NSNull null], @"contentsScale", [NSNull null], @"contentsScale",
[NSNull null], @"onOrderIn", [NSNull null], @"onOrderIn",
[NSNull null], @"onOrderOut", [NSNull null], @"onOrderOut",
[NSNull null], @"position",
[NSNull null], @"sublayers", [NSNull null], @"sublayers",
nil]; nil];
self.actions = actions; self.actions = actions;