Changeset 99911 in webkit
- Timestamp:
- Nov 10, 2011, 4:06:02 PM (14 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r99894 r99911 1 2011-11-10 Beth Dakin <bdakin@apple.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=66584 4 WebKit2's find bouncy looks blurry after dragging window onto >1.0 scale factor 5 display 6 -and corresponding- 7 <rdar://problem/9987559> 8 9 Reviewed by Anders Carlsson. 10 11 The setFindIndicator message and various functions of the same name must all take 12 an additional parameter indicating whether or not setting the find indicator 13 should result in a bounce animation. This is because when the device scale factor 14 changes, if there is currently a find indicator, it must be re-set to a higher or 15 lower resolution version, but we don't want the bounce animation to happen again. 16 * UIProcess/API/mac/FindIndicatorWindow.h: 17 * UIProcess/API/mac/FindIndicatorWindow.mm: 18 (WebKit::FindIndicatorWindow::setFindIndicator): 19 * UIProcess/API/mac/PageClientImpl.h: 20 * UIProcess/API/mac/PageClientImpl.mm: 21 (WebKit::PageClientImpl::setFindIndicator): 22 * UIProcess/API/mac/WKView.mm: 23 (-[WKView _setFindIndicator:fadeOut:animate:]): 24 * UIProcess/API/mac/WKViewInternal.h: 25 * UIProcess/PageClient.h: 26 * UIProcess/WebPageProxy.cpp: 27 (WebKit::WebPageProxy::setFindIndicator): 28 * UIProcess/WebPageProxy.h: 29 * UIProcess/WebPageProxy.messages.in: 30 31 New function FindController::isShowingOverlay() is used to determine if 32 FindController::deviceScaleFactorDidChange() needs to be called. 33 * WebProcess/WebPage/FindController.h: 34 (WebKit::FindController::isShowingOverlay): 35 36 FindController::deviceScaleFactorDidChange() calls updateFindIndicator to re- 37 generate the bitmap at the appropriate scale factor, but tells it not to animate 38 this time. 39 (WebKit::FindController::deviceScaleFactorDidChange): 40 41 updateFindIndicator() takes a new parameter indicating whether or not the 42 FindIndicator should animate. It defaults to true since the deviceScaleFactor 43 changing is the only case currently where we do not want it to animate. 44 * WebProcess/WebPage/FindController.cpp: 45 (WebKit::FindController::updateFindIndicator): 46 (WebKit::FindController::hideFindIndicator): 47 48 Calls into FindController::deviceScaleFactorDidChange() when the scale factor has 49 changed and the find overlay is showing. 50 * WebProcess/WebPage/WebPage.cpp: 51 (WebKit::WebPage::setDeviceScaleFactor): 52 1 53 2011-11-10 Timothy Hatcher <timothy@apple.com> 2 54 -
trunk/Source/WebKit2/UIProcess/API/mac/FindIndicatorWindow.h
r95901 r99911 48 48 ~FindIndicatorWindow(); 49 49 50 void setFindIndicator(PassRefPtr<FindIndicator>, bool fadeOut );50 void setFindIndicator(PassRefPtr<FindIndicator>, bool fadeOut, bool animate); 51 51 52 52 private: -
trunk/Source/WebKit2/UIProcess/API/mac/FindIndicatorWindow.mm
r95901 r99911 130 130 } 131 131 132 void FindIndicatorWindow::setFindIndicator(PassRefPtr<FindIndicator> findIndicator, bool fadeOut )132 void FindIndicatorWindow::setFindIndicator(PassRefPtr<FindIndicator> findIndicator, bool fadeOut, bool animate) 133 133 { 134 134 if (m_findIndicator == findIndicator) … … 164 164 [m_findIndicatorWindow.get() setReleasedWhenClosed:NO]; 165 165 166 // Start the bounce animation. 167 m_bounceAnimationContext = WKWindowBounceAnimationContextCreate(m_findIndicatorWindow.get()); 168 m_bounceAnimation.adoptNS([[WKFindIndicatorWindowAnimation alloc] _initWithFindIndicatorWindow:this 169 animationDuration:bounceAnimationDuration 170 animationProgressCallback:&FindIndicatorWindow::bounceAnimationCallback 171 animationDidEndCallback:&FindIndicatorWindow::bounceAnimationDidEnd]); 172 [m_bounceAnimation.get() startAnimation]; 166 if (animate) { 167 // Start the bounce animation. 168 m_bounceAnimationContext = WKWindowBounceAnimationContextCreate(m_findIndicatorWindow.get()); 169 m_bounceAnimation.adoptNS([[WKFindIndicatorWindowAnimation alloc] _initWithFindIndicatorWindow:this 170 animationDuration:bounceAnimationDuration 171 animationProgressCallback:&FindIndicatorWindow::bounceAnimationCallback 172 animationDidEndCallback:&FindIndicatorWindow::bounceAnimationDidEnd]); 173 [m_bounceAnimation.get() startAnimation]; 174 } 173 175 174 176 if (fadeOut) -
trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h
r98472 r99911 89 89 virtual PassRefPtr<WebContextMenuProxy> createContextMenuProxy(WebPageProxy*); 90 90 91 void setFindIndicator(PassRefPtr<FindIndicator>, bool fadeOut );91 void setFindIndicator(PassRefPtr<FindIndicator>, bool fadeOut, bool animate); 92 92 93 93 virtual void enterAcceleratedCompositingMode(const LayerTreeContext&); -
trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm
r98472 r99911 314 314 } 315 315 316 void PageClientImpl::setFindIndicator(PassRefPtr<FindIndicator> findIndicator, bool fadeOut )317 { 318 [m_wkView _setFindIndicator:findIndicator fadeOut:fadeOut ];316 void PageClientImpl::setFindIndicator(PassRefPtr<FindIndicator> findIndicator, bool fadeOut, bool animate) 317 { 318 [m_wkView _setFindIndicator:findIndicator fadeOut:fadeOut animate:animate]; 319 319 } 320 320 -
trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm
r99894 r99911 2338 2338 } 2339 2339 2340 - (void)_setFindIndicator:(PassRefPtr<FindIndicator>)findIndicator fadeOut:(BOOL)fadeOut 2340 - (void)_setFindIndicator:(PassRefPtr<FindIndicator>)findIndicator fadeOut:(BOOL)fadeOut animate:(BOOL)animate 2341 2341 { 2342 2342 if (!findIndicator) { … … 2348 2348 _data->_findIndicatorWindow = FindIndicatorWindow::create(self); 2349 2349 2350 _data->_findIndicatorWindow->setFindIndicator(findIndicator, fadeOut );2350 _data->_findIndicatorWindow->setFindIndicator(findIndicator, fadeOut, animate); 2351 2351 } 2352 2352 -
trunk/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h
r97804 r99911 61 61 - (NSRect)_convertToDeviceSpace:(NSRect)rect; 62 62 - (NSRect)_convertToUserSpace:(NSRect)rect; 63 - (void)_setFindIndicator:(PassRefPtr<WebKit::FindIndicator>)findIndicator fadeOut:(BOOL)fadeOut ;63 - (void)_setFindIndicator:(PassRefPtr<WebKit::FindIndicator>)findIndicator fadeOut:(BOOL)fadeOut animate:(BOOL)animate; 64 64 65 65 - (void)_enterAcceleratedCompositingMode:(const WebKit::LayerTreeContext&)layerTreeContext; -
trunk/Source/WebKit2/UIProcess/PageClient.h
r99178 r99911 152 152 virtual PassRefPtr<WebContextMenuProxy> createContextMenuProxy(WebPageProxy*) = 0; 153 153 154 virtual void setFindIndicator(PassRefPtr<FindIndicator>, bool fadeOut ) = 0;154 virtual void setFindIndicator(PassRefPtr<FindIndicator>, bool fadeOut, bool animate) = 0; 155 155 #if PLATFORM(WIN) 156 156 virtual void didInstallOrUninstallPageOverlay(bool) = 0; -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r99188 r99911 2403 2403 } 2404 2404 2405 void WebPageProxy::setFindIndicator(const FloatRect& selectionRectInWindowCoordinates, const Vector<FloatRect>& textRectsInSelectionRectCoordinates, float contentImageScaleFactor, const ShareableBitmap::Handle& contentImageHandle, bool fadeOut )2405 void WebPageProxy::setFindIndicator(const FloatRect& selectionRectInWindowCoordinates, const Vector<FloatRect>& textRectsInSelectionRectCoordinates, float contentImageScaleFactor, const ShareableBitmap::Handle& contentImageHandle, bool fadeOut, bool animate) 2406 2406 { 2407 2407 RefPtr<FindIndicator> findIndicator = FindIndicator::create(selectionRectInWindowCoordinates, textRectsInSelectionRectCoordinates, contentImageScaleFactor, contentImageHandle); 2408 m_pageClient->setFindIndicator(findIndicator.release(), fadeOut );2408 m_pageClient->setFindIndicator(findIndicator.release(), fadeOut, animate); 2409 2409 } 2410 2410 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r99188 r99911 432 432 void countStringMatches(const String&, FindOptions, unsigned maxMatchCount); 433 433 void didCountStringMatches(const String&, uint32_t matchCount); 434 void setFindIndicator(const WebCore::FloatRect& selectionRectInWindowCoordinates, const Vector<WebCore::FloatRect>& textRectsInSelectionRectCoordinates, float contentImageScaleFactor, const ShareableBitmap::Handle& contentImageHandle, bool fadeOut );434 void setFindIndicator(const WebCore::FloatRect& selectionRectInWindowCoordinates, const Vector<WebCore::FloatRect>& textRectsInSelectionRectCoordinates, float contentImageScaleFactor, const ShareableBitmap::Handle& contentImageHandle, bool fadeOut, bool animate); 435 435 void didFindString(const String&, uint32_t matchCount); 436 436 void didFailToFindString(const String&); -
trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in
r99108 r99911 166 166 # Find messages 167 167 DidCountStringMatches(WTF::String string, uint32_t matchCount) 168 SetFindIndicator(WebCore::FloatRect selectionRect, Vector<WebCore::FloatRect> textRects, float contentImageScaleFactor, WebKit::ShareableBitmap::Handle contentImageHandle, bool fadeOut )168 SetFindIndicator(WebCore::FloatRect selectionRect, Vector<WebCore::FloatRect> textRects, float contentImageScaleFactor, WebKit::ShareableBitmap::Handle contentImageHandle, bool fadeOut, bool animate) 169 169 DidFindString(WTF::String string, uint32_t matchCount) 170 170 DidFailToFindString(WTF::String string) -
trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp
r95901 r99911 160 160 } 161 161 162 bool FindController::updateFindIndicator(Frame* selectedFrame, bool isShowingOverlay )162 bool FindController::updateFindIndicator(Frame* selectedFrame, bool isShowingOverlay, bool shouldAnimate) 163 163 { 164 164 if (!selectedFrame) … … 212 212 textRectsInSelectionRectCoordinates.append(textRectInSelectionRectCoordinates); 213 213 } 214 215 m_webPage->send(Messages::WebPageProxy::SetFindIndicator(selectionRectInWindowCoordinates, textRectsInSelectionRectCoordinates, m_webPage->corePage()->deviceScaleFactor(), handle, !isShowingOverlay ));214 215 m_webPage->send(Messages::WebPageProxy::SetFindIndicator(selectionRectInWindowCoordinates, textRectsInSelectionRectCoordinates, m_webPage->corePage()->deviceScaleFactor(), handle, !isShowingOverlay, shouldAnimate)); 216 216 m_isShowingFindIndicator = true; 217 217 … … 225 225 226 226 ShareableBitmap::Handle handle; 227 m_webPage->send(Messages::WebPageProxy::SetFindIndicator(FloatRect(), Vector<FloatRect>(), m_webPage->corePage()->deviceScaleFactor(), handle, false ));227 m_webPage->send(Messages::WebPageProxy::SetFindIndicator(FloatRect(), Vector<FloatRect>(), m_webPage->corePage()->deviceScaleFactor(), handle, false, true)); 228 228 m_isShowingFindIndicator = false; 229 229 } … … 236 236 237 237 updateFindIndicator(selectedFrame, false); 238 } 239 240 void FindController::deviceScaleFactorDidChange() 241 { 242 ASSERT(isShowingOverlay()); 243 244 Frame* selectedFrame = frameWithSelection(m_webPage->corePage()); 245 if (!selectedFrame) 246 return; 247 248 updateFindIndicator(selectedFrame, true, false); 238 249 } 239 250 -
trunk/Source/WebKit2/WebProcess/WebPage/FindController.h
r95901 r99911 56 56 void showFindIndicatorInSelection(); 57 57 58 bool isShowingOverlay() const { return m_isShowingFindIndicator && m_findPageOverlay; } 59 60 void deviceScaleFactorDidChange(); 61 58 62 private: 59 63 // PageOverlay::Client. … … 65 69 66 70 Vector<WebCore::IntRect> rectsForTextMatches(); 67 bool updateFindIndicator(WebCore::Frame* selectedFrame, bool isShowingOverlay );71 bool updateFindIndicator(WebCore::Frame* selectedFrame, bool isShowingOverlay, bool shouldAnimate = true); 68 72 69 73 private: -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r99725 r99911 875 875 (*it)->setDeviceScaleFactor(scaleFactor); 876 876 #endif 877 878 if (m_findController.isShowingOverlay()) { 879 // We must have updated layout to get the selection rects right. 880 layoutIfNeeded(); 881 m_findController.deviceScaleFactorDidChange(); 882 } 877 883 } 878 884
Note:
See TracChangeset
for help on using the changeset viewer.