Changeset 162655 in webkit
- Timestamp:
- Jan 23, 2014 3:28:54 PM (10 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r162654 r162655 1 2014-01-23 Anders Carlsson <andersca@apple.com> 2 3 Clean up WKView.mm a little 4 https://bugs.webkit.org/show_bug.cgi?id=127517 5 6 Reviewed by Tim Horton. 7 8 Remove an unused ivar and migrate to API constants that were added in Lion. 9 10 * UIProcess/API/mac/WKView.mm: 11 (-[WKView setFrameSize:]): 12 (-[WKView addWindowObserversForWindow:]): 13 (-[WKView removeWindowObservers]): 14 (-[WKView viewDidMoveToWindow]): 15 (-[WKView _windowDidMiniaturize:]): 16 (-[WKView _windowDidResize:]): 17 (-[WKView _windowDidChangeBackingProperties:]): 18 1 19 2014-01-23 Anders Carlsson <andersca@apple.com> 2 20 -
trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm
r162580 r162655 204 204 BOOL _didScheduleWindowAndViewFrameUpdate; 205 205 206 // Whether the containing window of the WKView has a valid backing store.207 // The window server invalidates the backing store whenever the window is resized or minimized.208 // We use this flag to determine when we need to paint the background (white or clear)209 // when the web process is unresponsive or takes too long to paint.210 BOOL _windowHasValidBackingStore;211 212 206 RetainPtr<NSColorSpace> _colorSpace; 213 207 … … 405 399 - (void)setFrameSize:(NSSize)size 406 400 { 407 if (!NSEqualSizes(size, [self frame].size))408 _data->_windowHasValidBackingStore = NO;409 410 401 [super setFrameSize:size]; 411 402 … … 1818 1809 } 1819 1810 1820 // FIXME: Use AppKit constants for these when they are available.1821 static NSString * const windowDidChangeBackingPropertiesNotification = @"NSWindowDidChangeBackingPropertiesNotification";1822 static NSString * const backingPropertyOldScaleFactorKey = @"NSBackingPropertyOldScaleFactorKey";1823 1824 1811 - (void)addWindowObserversForWindow:(NSWindow *)window 1825 1812 { … … 1842 1829 name:@"_NSWindowDidBecomeVisible" object:window]; 1843 1830 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidChangeBackingProperties:) 1844 name: windowDidChangeBackingPropertiesNotification object:window];1831 name:NSWindowDidChangeBackingPropertiesNotification object:window]; 1845 1832 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidChangeScreen:) 1846 1833 name:NSWindowDidChangeScreenNotification object:window]; … … 1867 1854 [[NSNotificationCenter defaultCenter] removeObserver:self name:@"NSWindowDidOrderOffScreenNotification" object:window]; 1868 1855 [[NSNotificationCenter defaultCenter] removeObserver:self name:@"_NSWindowDidBecomeVisible" object:window]; 1869 [[NSNotificationCenter defaultCenter] removeObserver:self name: windowDidChangeBackingPropertiesNotification object:window];1856 [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidChangeBackingPropertiesNotification object:window]; 1870 1857 [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidChangeScreenNotification object:window]; 1871 1858 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 … … 1889 1876 { 1890 1877 if ([self window]) { 1891 _data->_windowHasValidBackingStore = NO;1892 1878 [self doWindowDidChangeScreen]; 1893 1879 … … 1956 1942 - (void)_windowDidMiniaturize:(NSNotification *)notification 1957 1943 { 1958 _data->_windowHasValidBackingStore = NO;1959 1944 _data->_page->viewStateDidChange(ViewState::IsVisible); 1960 1945 } … … 1972 1957 - (void)_windowDidResize:(NSNotification *)notification 1973 1958 { 1974 _data->_windowHasValidBackingStore = NO;1975 1976 1959 [self _updateWindowAndViewFrames]; 1977 1960 } … … 1989 1972 - (void)_windowDidChangeBackingProperties:(NSNotification *)notification 1990 1973 { 1991 CGFloat oldBackingScaleFactor = [ [notification.userInfo objectForKey:backingPropertyOldScaleFactorKey] doubleValue];1992 CGFloat newBackingScaleFactor = [self _intrinsicDeviceScaleFactor]; 1974 CGFloat oldBackingScaleFactor = [notification.userInfo[NSBackingPropertyOldScaleFactorKey] doubleValue]; 1975 CGFloat newBackingScaleFactor = [self _intrinsicDeviceScaleFactor]; 1993 1976 if (oldBackingScaleFactor == newBackingScaleFactor) 1994 1977 return; 1995 1978 1996 _data->_windowHasValidBackingStore = NO;1997 1979 _data->_page->setIntrinsicDeviceScaleFactor(newBackingScaleFactor); 1998 1980 }
Note: See TracChangeset
for help on using the changeset viewer.