Changeset 70737 in webkit
- Timestamp:
- Oct 27, 2010 6:44:58 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit2/ChangeLog
r70734 r70737 1 2010-10-27 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 Find indicators do not bounce 6 https://bugs.webkit.org/show_bug.cgi?id=48490 7 <rdar://problem/8564276> 8 9 * UIProcess/API/mac/FindIndicatorWindow.h: 10 * UIProcess/API/mac/FindIndicatorWindow.mm: 11 (-[WebFindIndicatorWindowAnimation _initWithFindIndicatorWindow:WebKit::animationDuration:animationProgressCallback:WebKit::FindIndicatorWindow::animationDidEndCallback:WebKit::FindIndicatorWindow::]): 12 Add an animationDuration parameter. 13 14 (WebKit::FindIndicatorWindow::FindIndicatorWindow): 15 Initialize m_bounceAnimationContext. 16 17 (WebKit::FindIndicatorWindow::setFindIndicator): 18 Create a bounce animation and start it. 19 20 (WebKit::FindIndicatorWindow::closeWindow): 21 Stop the bounce animation and destroy the bounce animation context. 22 23 (WebKit::FindIndicatorWindow::startFadeOutTimerFired): 24 pass the fade out duration. 25 26 (WebKit::FindIndicatorWindow::bounceAnimationCallback): 27 Set the bounce animation progress. 28 29 (WebKit::FindIndicatorWindow::bounceAnimationDidEnd): 30 Destroy the bounce animation context. 31 1 32 2010-10-27 Kenneth Rohde Christiansen <kenneth@webkit.org> 2 33 -
trunk/WebKit2/UIProcess/API/mac/FindIndicatorWindow.h
r69895 r70737 32 32 #import <wtf/RetainPtr.h> 33 33 #import "RunLoop.h" 34 #import "WebKitSystemInterface.h" 34 35 35 36 @class WKView; … … 58 59 void fadeOutAnimationDidEnd(); 59 60 61 void bounceAnimationCallback(double); 62 void bounceAnimationDidEnd(); 63 60 64 WKView* m_wkView; 61 65 RefPtr<FindIndicator> m_findIndicator; 62 66 RetainPtr<NSWindow> m_findIndicatorWindow; 67 68 WKWindowBounceAnimationContextRef m_bounceAnimationContext; 69 RetainPtr<WebFindIndicatorWindowAnimation> m_bounceAnimation; 63 70 64 71 RunLoop::Timer<FindIndicatorWindow> m_startFadeOutTimer; -
trunk/WebKit2/UIProcess/API/mac/FindIndicatorWindow.mm
r70001 r70737 29 29 #include <WebCore/GraphicsContext.h> 30 30 31 static const double pulseAnimationDuration = 0.12;32 static const double timeBeforeFadeStarts = pulseAnimationDuration + 0.2;31 static const double bounceAnimationDuration = 0.12; 32 static const double timeBeforeFadeStarts = bounceAnimationDuration + 0.2; 33 33 static const double fadeOutAnimationDuration = 0.3; 34 34 … … 73 73 74 74 - (id)_initWithFindIndicatorWindow:(WebKit::FindIndicatorWindow *)findIndicatorWindow 75 animationProgressCallback:(void (WebKit::FindIndicatorWindow::*)(double progress))animationProgressCallback 76 animationDidEndCallback:(void (WebKit::FindIndicatorWindow::*)())animationDidEndCallback; 75 animationDuration:(CFTimeInterval)duration 76 animationProgressCallback:(void (WebKit::FindIndicatorWindow::*)(double progress))animationProgressCallback 77 animationDidEndCallback:(void (WebKit::FindIndicatorWindow::*)())animationDidEndCallback; 77 78 @end 78 79 … … 80 81 81 82 - (id)_initWithFindIndicatorWindow:(WebKit::FindIndicatorWindow *)findIndicatorWindow 83 animationDuration:(CFTimeInterval)animationDuration 82 84 animationProgressCallback:(void (WebKit::FindIndicatorWindow::*)(double progress))animationProgressCallback 83 85 animationDidEndCallback:(void (WebKit::FindIndicatorWindow::*)())animationDidEndCallback 84 86 { 85 if ((self = [super initWithDuration: fadeOutAnimationDuration animationCurve:NSAnimationEaseInOut])) {87 if ((self = [super initWithDuration:animationDuration animationCurve:NSAnimationEaseInOut])) { 86 88 _findIndicatorWindow = findIndicatorWindow; 87 89 _animationProgressCallback = animationProgressCallback; … … 116 118 FindIndicatorWindow::FindIndicatorWindow(WKView *wkView) 117 119 : m_wkView(wkView) 120 , m_bounceAnimationContext(0) 118 121 , m_startFadeOutTimer(RunLoop::main(), this, &FindIndicatorWindow::startFadeOutTimerFired) 119 122 { … … 159 162 [m_findIndicatorWindow.get() setReleasedWhenClosed:NO]; 160 163 164 // Start the bounce animation. 165 m_bounceAnimationContext = WKWindowBounceAnimationContextCreate(m_findIndicatorWindow.get()); 166 m_bounceAnimation.adoptNS([[WebFindIndicatorWindowAnimation alloc] _initWithFindIndicatorWindow:this 167 animationDuration:bounceAnimationDuration 168 animationProgressCallback:&FindIndicatorWindow::bounceAnimationCallback 169 animationDidEndCallback:&FindIndicatorWindow::bounceAnimationDidEnd]); 170 [m_bounceAnimation.get() startAnimation]; 171 161 172 if (fadeOut) 162 173 m_startFadeOutTimer.startOneShot(timeBeforeFadeStarts); … … 175 186 } 176 187 188 if (m_bounceAnimation) { 189 [m_bounceAnimation.get() stopAnimation]; 190 m_bounceAnimation = nullptr; 191 } 192 193 if (m_bounceAnimationContext) 194 WKWindowBounceAnimationContextDestroy(m_bounceAnimationContext); 195 177 196 [[m_findIndicatorWindow.get() parentWindow] removeChildWindow:m_findIndicatorWindow.get()]; 178 197 [m_findIndicatorWindow.get() close]; … … 184 203 ASSERT(!m_fadeOutAnimation); 185 204 186 m_fadeOutAnimation.adoptNS([[WebFindIndicatorWindowAnimation alloc] _initWithFindIndicatorWindow:this 205 m_fadeOutAnimation.adoptNS([[WebFindIndicatorWindowAnimation alloc] _initWithFindIndicatorWindow:this 206 animationDuration:fadeOutAnimationDuration 187 207 animationProgressCallback:&FindIndicatorWindow::fadeOutAnimationCallback 188 208 animationDidEndCallback:&FindIndicatorWindow::fadeOutAnimationDidEnd]); … … 205 225 } 206 226 227 void FindIndicatorWindow::bounceAnimationCallback(double progress) 228 { 229 ASSERT(m_bounceAnimation); 230 ASSERT(m_bounceAnimationContext); 231 232 WKWindowBounceAnimationSetAnimationProgress(m_bounceAnimationContext, progress); 233 } 234 235 void FindIndicatorWindow::bounceAnimationDidEnd() 236 { 237 ASSERT(m_bounceAnimation); 238 ASSERT(m_bounceAnimationContext); 239 ASSERT(m_findIndicatorWindow); 240 241 WKWindowBounceAnimationContextDestroy(m_bounceAnimationContext); 242 m_bounceAnimationContext = 0; 243 } 244 207 245 } // namespace WebKit -
trunk/WebKitLibraries/ChangeLog
r70539 r70737 1 2010-10-27 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 Find indicators do not bounce 6 https://bugs.webkit.org/show_bug.cgi?id=48490 7 <rdar://problem/8564276> 8 9 Add bounce animation context functions. 10 11 * WebKitSystemInterface.h: 12 * libWebKitSystemInterfaceLeopard.a: 13 * libWebKitSystemInterfaceSnowLeopard.a: 14 1 15 2010-10-26 Adam Roben <aroben@apple.com> 2 16 -
trunk/WebKitLibraries/WebKitSystemInterface.h
r70400 r70737 291 291 CALayer *WKCARemoteLayerClientGetLayer(WKCARemoteLayerClientRef); 292 292 293 typedef struct __WKWindowBounceAnimationContext *WKWindowBounceAnimationContextRef; 294 295 WKWindowBounceAnimationContextRef WKWindowBounceAnimationContextCreate(NSWindow *window); 296 void WKWindowBounceAnimationContextDestroy(WKWindowBounceAnimationContextRef context); 297 void WKWindowBounceAnimationSetAnimationProgress(WKWindowBounceAnimationContextRef context, double animationProgress); 298 293 299 #if defined(__x86_64__) 294 300 #import <mach/mig.h>
Note: See TracChangeset
for help on using the changeset viewer.