diff options
author | Steve Block <steveblock@google.com> | 2009-12-15 10:12:09 +0000 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2009-12-17 17:41:10 +0000 |
commit | 643ca7872b450ea4efacab6188849e5aac2ba161 (patch) | |
tree | 6982576c228bcd1a7efe98afed544d840751094c /WebKitTools/DumpRenderTree/mac/DumpRenderTreeWindow.mm | |
parent | d026980fde6eb3b01c1fe49441174e89cd1be298 (diff) | |
download | external_webkit-643ca7872b450ea4efacab6188849e5aac2ba161.zip external_webkit-643ca7872b450ea4efacab6188849e5aac2ba161.tar.gz external_webkit-643ca7872b450ea4efacab6188849e5aac2ba161.tar.bz2 |
Merge webkit.org at r51976 : Initial merge by git.
Change-Id: Ib0e7e2f0fb4bee5a186610272edf3186f0986b43
Diffstat (limited to 'WebKitTools/DumpRenderTree/mac/DumpRenderTreeWindow.mm')
-rw-r--r-- | WebKitTools/DumpRenderTree/mac/DumpRenderTreeWindow.mm | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/WebKitTools/DumpRenderTree/mac/DumpRenderTreeWindow.mm b/WebKitTools/DumpRenderTree/mac/DumpRenderTreeWindow.mm index aa5b117..8845ef0 100644 --- a/WebKitTools/DumpRenderTree/mac/DumpRenderTreeWindow.mm +++ b/WebKitTools/DumpRenderTree/mac/DumpRenderTreeWindow.mm @@ -67,7 +67,7 @@ static CFArrayCallBacks NonRetainingArrayCallbacks = { - (void)close { - [self stopObservingWebView]; + [[NSNotificationCenter defaultCenter] removeObserver:self]; CFRange arrayRange = CFRangeMake(0, CFArrayGetCount(openWindowsRef)); CFIndex i = CFArrayGetFirstIndexOfValue(openWindowsRef, arrayRange, self); @@ -99,32 +99,20 @@ static CFArrayCallBacks NonRetainingArrayCallbacks = { return nil; } -- (void)startObservingWebView +- (void)startListeningForAcceleratedCompositingChanges { - [self stopObservingWebView]; - [[self webView] addObserver:self forKeyPath:@"_isUsingAcceleratedCompositing" options:0 context:0]; - observingWebView = YES; + [[self webView] _setPostsAcceleratedCompositingNotifications:YES]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(webViewStartedAcceleratedCompositing:) + name:_WebViewDidStartAcceleratedCompositingNotification object:nil]; } -- (void)stopObservingWebView +- (void)webViewStartedAcceleratedCompositing:(NSNotification *)notification { - if (!observingWebView) - return; - [[self webView] removeObserver:self forKeyPath:@"_isUsingAcceleratedCompositing"]; - observingWebView = NO; -} - -- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context -{ - if ([keyPath isEqualToString:@"_isUsingAcceleratedCompositing"]) { - // When using accelerated compositing, the window needs to be autodisplay for AppKit/CA to - // start accelerated animations correctly. - BOOL isAccelerated = [[self webView] _isUsingAcceleratedCompositing]; - [self setAutodisplay:isAccelerated]; - return; - } - - [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; + // If the WebView has gone into compositing mode, turn on window autodisplay. This is necessary for CA + // to update layers and start animations. + // We only ever turn autodisplay on here, because we turn it off before every test. + if ([[self webView] _isUsingAcceleratedCompositing]) + [self setAutodisplay:YES]; } @end |