Changeset 206945 in webkit
- Timestamp:
- Oct 7, 2016, 5:20:05 PM (9 years ago)
- Location:
- trunk/Source/WebKit/mac
- Files:
-
- 4 edited
-
ChangeLog (modified) (1 diff)
-
WebView/WebClipView.h (modified) (1 diff)
-
WebView/WebClipView.mm (modified) (3 diffs)
-
WebView/WebHTMLView.mm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/mac/ChangeLog
r206867 r206945 1 2016-10-07 Simon Fraser <simon.fraser@apple.com> 2 3 [WK1 Mac] Fix repaints of fixed-background elements in layer-backed WebViews 4 https://bugs.webkit.org/show_bug.cgi?id=163154 5 rdar://problem/28674216 6 7 Reviewed by Tim Horton. 8 9 r55159 added code to counteract AppKit's adjustment of dirty regions during scrolling, 10 by offsetting the dirty rect in -setNeedsDisplayInRect: if the call happens during 11 the NSViewBoundsDidChangeNotification handling. 12 13 However, AppKit only does dirty region adjustment in the code path that blits ("copy 14 on scroll"), so r55159 produces incorrect behavior in, for example, layer-backed views. 15 16 Fix by overriding -[NSClipView _canCopyOnScrollForDeltaX:deltaY:] to know if a single 17 scroll is going to blit, and only do adjustments in -setNeedsDisplayInRect: if it is. 18 19 * WebView/WebClipView.h: 20 * WebView/WebClipView.mm: 21 (-[WebClipView _immediateScrollToPoint:]): 22 (-[WebClipView _canCopyOnScrollForDeltaX:deltaY:]): 23 (-[WebClipView currentScrollIsBlit]): 24 * WebView/WebHTMLView.mm: 25 (-[WebHTMLView setNeedsDisplayInRect:]): 26 (-[WebHTMLView drawRect:]): 27 1 28 2016-10-06 Youenn Fablet <youenn@apple.com> 2 29 -
trunk/Source/WebKit/mac/WebView/WebClipView.h
r165676 r206945 35 35 BOOL _haveAdditionalClip; 36 36 BOOL _isScrolling; 37 BOOL _currentScrollIsBlit; 37 38 NSRect _additionalClip; 38 39 } 39 40 41 - (BOOL)currentScrollIsBlit; 40 42 - (void)setAdditionalClip:(NSRect)additionalClip; 41 43 - (void)resetAdditionalClip; -
trunk/Source/WebKit/mac/WebView/WebClipView.mm
r181587 r206945 51 51 @interface NSClipView (WebNSClipViewDetails) 52 52 - (void)_immediateScrollToPoint:(NSPoint)newOrigin; 53 - (BOOL)_canCopyOnScrollForDeltaX:(CGFloat)deltaX deltaY:(CGFloat)deltaY; 53 54 @end 54 55 … … 105 106 { 106 107 _isScrolling = YES; 108 _currentScrollIsBlit = NO; 107 109 108 110 [[self window] _disableDelayedWindowDisplay]; … … 125 127 126 128 _isScrolling = NO; 129 } 130 131 - (BOOL)_canCopyOnScrollForDeltaX:(CGFloat)deltaX deltaY:(CGFloat)deltaY 132 { 133 _currentScrollIsBlit = [super _canCopyOnScrollForDeltaX:deltaX deltaY:deltaY]; 134 return _currentScrollIsBlit; 135 } 136 137 - (BOOL)currentScrollIsBlit 138 { 139 return _currentScrollIsBlit; 127 140 } 128 141 -
trunk/Source/WebKit/mac/WebView/WebHTMLView.mm
r206917 r206945 4111 4111 #endif 4112 4112 4113 static BOOL currentScrollIsBlit(NSView *clipView) 4114 { 4115 #if PLATFORM(MAC) 4116 return [clipView isKindOfClass:[WebClipView class]] && [(WebClipView *)clipView currentScrollIsBlit]; 4117 #else 4118 return NO; 4119 #endif 4120 } 4121 4122 // FIXME: this entire function could be #ifdeffed out on iOS. The below workaround is AppKit-specific. 4113 4123 - (void)setNeedsDisplayInRect:(NSRect)invalidRect 4114 4124 { 4115 if (_private->inScrollPositionChanged ) {4125 if (_private->inScrollPositionChanged && currentScrollIsBlit([self superview])) { 4116 4126 // When scrolling, the dirty regions are adjusted for the scroll only 4117 4127 // after NSViewBoundsDidChangeNotification is sent. Translate the invalid … … 4228 4238 const float cWastedSpaceThreshold = 0.75f; 4229 4239 BOOL useUnionedRect = (count <= 1) || (count > cRectThreshold); 4230 if (!useUnionedRect) { 4240 if (!useUnionedRect) { 4231 4241 // Attempt to guess whether or not we should use the unioned rect or the individual rects. 4232 4242 // We do this by computing the percentage of "wasted space" in the union. If that wasted space
Note:
See TracChangeset
for help on using the changeset viewer.