Title: [140769] trunk/Source/WebKit2
Revision
140769
Author
[email protected]
Date
2013-01-24 19:47:28 -0800 (Thu, 24 Jan 2013)

Log Message

[wk2] Page overlays should do their own animation, instead of relying on implicit animation
https://bugs.webkit.org/show_bug.cgi?id=107896
<rdar://problem/12900058>

Reviewed by Sam Weinig.

Use PageOverlay's animation instead of CA implicit animations for uninstallPageOverlay.

Make WKBundlePageInstallPageOverlay/WKBundlePageUninstallPageOverlay default to no animation.

Add WKBundlePageInstallPageOverlayWithAnimation/WKBundlePageUninstallPageOverlayWithAnimation.

* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageUninstallPageOverlay): The default for shouldFadeOut is now false, so we don't need to pass it.
(WKBundlePageInstallPageOverlayWithAnimation): Add a version of WKBundlePageInstallPageOverlay that fades in.
(WKBundlePageUninstallPageOverlayWithAnimation): Add a version of WKBundlePageUninstallPageOverlay that fades out.
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
(WebKit::WebInspectorClient::highlight): installPageOverlay used to animate by default, now we need to ask for it.
(WebKit::WebInspectorClient::hideHighlight): uninstallPageOverlay used to implicitly animate accidentally, now we need to ask for it.
* WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::updateFindUIAfterPageScroll): Ditto.
(WebKit::FindController::hideFindUI): Ditto.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::installPageOverlay): Add shouldFadeIn parameter.
(WebKit::WebPage::uninstallPageOverlay):
* WebProcess/WebPage/WebPage.h:
(WebPage): Add shouldFadeIn to installPageOverlay; make both it and uninstallPageOverlay's shouldFade out default to false.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::destroyPageOverlayLayer): Disable implicit animations when removing a page overlay.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (140768 => 140769)


--- trunk/Source/WebKit2/ChangeLog	2013-01-25 03:43:29 UTC (rev 140768)
+++ trunk/Source/WebKit2/ChangeLog	2013-01-25 03:47:28 UTC (rev 140769)
@@ -1,3 +1,36 @@
+2013-01-24  Tim Horton  <[email protected]>
+
+        [wk2] Page overlays should do their own animation, instead of relying on implicit animation
+        https://bugs.webkit.org/show_bug.cgi?id=107896
+        <rdar://problem/12900058>
+
+        Reviewed by Sam Weinig.
+
+        Use PageOverlay's animation instead of CA implicit animations for uninstallPageOverlay.
+
+        Make WKBundlePageInstallPageOverlay/WKBundlePageUninstallPageOverlay default to no animation.
+
+        Add WKBundlePageInstallPageOverlayWithAnimation/WKBundlePageUninstallPageOverlayWithAnimation.
+
+        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
+        (WKBundlePageUninstallPageOverlay): The default for shouldFadeOut is now false, so we don't need to pass it.
+        (WKBundlePageInstallPageOverlayWithAnimation): Add a version of WKBundlePageInstallPageOverlay that fades in.
+        (WKBundlePageUninstallPageOverlayWithAnimation): Add a version of WKBundlePageUninstallPageOverlay that fades out.
+        * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
+        * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
+        (WebKit::WebInspectorClient::highlight): installPageOverlay used to animate by default, now we need to ask for it.
+        (WebKit::WebInspectorClient::hideHighlight): uninstallPageOverlay used to implicitly animate accidentally, now we need to ask for it.
+        * WebProcess/WebPage/FindController.cpp:
+        (WebKit::FindController::updateFindUIAfterPageScroll): Ditto.
+        (WebKit::FindController::hideFindUI): Ditto.
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::installPageOverlay): Add shouldFadeIn parameter.
+        (WebKit::WebPage::uninstallPageOverlay):
+        * WebProcess/WebPage/WebPage.h:
+        (WebPage): Add shouldFadeIn to installPageOverlay; make both it and uninstallPageOverlay's shouldFade out default to false.
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+        (WebKit::TiledCoreAnimationDrawingArea::destroyPageOverlayLayer): Disable implicit animations when removing a page overlay.
+
 2013-01-24  Huang Dongsung  <[email protected]>
 
         [EFL] Unreviewed build fix after r140752.

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp (140768 => 140769)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp	2013-01-25 03:43:29 UTC (rev 140768)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp	2013-01-25 03:47:28 UTC (rev 140769)
@@ -295,9 +295,19 @@
 
 void WKBundlePageUninstallPageOverlay(WKBundlePageRef pageRef, WKBundlePageOverlayRef pageOverlayRef)
 {
-    toImpl(pageRef)->uninstallPageOverlay(toImpl(pageOverlayRef), false);
+    toImpl(pageRef)->uninstallPageOverlay(toImpl(pageOverlayRef));
 }
 
+void WKBundlePageInstallPageOverlayWithAnimation(WKBundlePageRef pageRef, WKBundlePageOverlayRef pageOverlayRef)
+{
+    toImpl(pageRef)->installPageOverlay(toImpl(pageOverlayRef), true);
+}
+
+void WKBundlePageUninstallPageOverlayWithAnimation(WKBundlePageRef pageRef, WKBundlePageOverlayRef pageOverlayRef)
+{
+    toImpl(pageRef)->uninstallPageOverlay(toImpl(pageOverlayRef), true);
+}
+
 bool WKBundlePageHasLocalDataForURL(WKBundlePageRef pageRef, WKURLRef urlRef)
 {
     return toImpl(pageRef)->hasLocalDataForURL(WebCore::KURL(WebCore::KURL(), toWTFString(urlRef)));

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h (140768 => 140769)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h	2013-01-25 03:43:29 UTC (rev 140768)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h	2013-01-25 03:47:28 UTC (rev 140769)
@@ -419,6 +419,9 @@
 WK_EXPORT void WKBundlePageInstallPageOverlay(WKBundlePageRef page, WKBundlePageOverlayRef pageOverlay);
 WK_EXPORT void WKBundlePageUninstallPageOverlay(WKBundlePageRef page, WKBundlePageOverlayRef pageOverlay);
 
+WK_EXPORT void WKBundlePageInstallPageOverlayWithAnimation(WKBundlePageRef page, WKBundlePageOverlayRef pageOverlay);
+WK_EXPORT void WKBundlePageUninstallPageOverlayWithAnimation(WKBundlePageRef page, WKBundlePageOverlayRef pageOverlay);
+
 WK_EXPORT bool WKBundlePageHasLocalDataForURL(WKBundlePageRef page, WKURLRef url);
 WK_EXPORT bool WKBundlePageCanHandleRequest(WKURLRequestRef request);
 

Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.cpp (140768 => 140769)


--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.cpp	2013-01-25 03:43:29 UTC (rev 140768)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.cpp	2013-01-25 03:47:28 UTC (rev 140769)
@@ -73,7 +73,7 @@
     if (!m_highlightOverlay) {
         RefPtr<PageOverlay> highlightOverlay = PageOverlay::create(this);
         m_highlightOverlay = highlightOverlay.get();
-        m_page->installPageOverlay(highlightOverlay.release());
+        m_page->installPageOverlay(highlightOverlay.release(), true);
     } else
         m_highlightOverlay->setNeedsDisplay();
 }
@@ -81,7 +81,7 @@
 void WebInspectorClient::hideHighlight()
 {
     if (m_highlightOverlay)
-        m_page->uninstallPageOverlay(m_highlightOverlay, false);
+        m_page->uninstallPageOverlay(m_highlightOverlay, true);
 }
 
 bool WebInspectorClient::sendMessageToFrontend(const String& message)

Modified: trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp (140768 => 140769)


--- trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp	2013-01-25 03:43:29 UTC (rev 140768)
+++ trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp	2013-01-25 03:47:28 UTC (rev 140769)
@@ -163,7 +163,7 @@
     if (!shouldShowOverlay) {
         if (m_findPageOverlay) {
             // Get rid of the overlay.
-            m_webPage->uninstallPageOverlay(m_findPageOverlay, false);
+            m_webPage->uninstallPageOverlay(m_findPageOverlay, true);
         }
         
         ASSERT(!m_findPageOverlay);
@@ -171,7 +171,7 @@
         if (!m_findPageOverlay) {
             RefPtr<PageOverlay> findPageOverlay = PageOverlay::create(this);
             m_findPageOverlay = findPageOverlay.get();
-            m_webPage->installPageOverlay(findPageOverlay.release());
+            m_webPage->installPageOverlay(findPageOverlay.release(), true);
         } else {
             // The page overlay needs to be repainted.
             m_findPageOverlay->setNeedsDisplay();
@@ -279,7 +279,7 @@
 {
     m_findMatches.clear();
     if (m_findPageOverlay)
-        m_webPage->uninstallPageOverlay(m_findPageOverlay, false);
+        m_webPage->uninstallPageOverlay(m_findPageOverlay, true);
 
     PluginView* pluginView = pluginViewForFrame(m_webPage->mainFrame());
     

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (140768 => 140769)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2013-01-25 03:43:29 UTC (rev 140768)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2013-01-25 03:47:28 UTC (rev 140769)
@@ -1347,10 +1347,8 @@
     injectedBundle->didReceiveMessageToPage(this, messageName, messageBody.get());
 }
 
-void WebPage::installPageOverlay(PassRefPtr<PageOverlay> pageOverlay)
+void WebPage::installPageOverlay(PassRefPtr<PageOverlay> pageOverlay, bool shouldFadeIn)
 {
-    bool shouldFadeIn = true;
-    
     if (m_pageOverlay) {
         m_pageOverlay->setPage(0);
 
@@ -1371,12 +1369,12 @@
     m_pageOverlay->setNeedsDisplay();
 }
 
-void WebPage::uninstallPageOverlay(PageOverlay* pageOverlay, bool fadeOut)
+void WebPage::uninstallPageOverlay(PageOverlay* pageOverlay, bool shouldFadeOut)
 {
     if (pageOverlay != m_pageOverlay)
         return;
 
-    if (fadeOut) {
+    if (shouldFadeOut) {
         m_pageOverlay->startFadeOutAnimation();
         return;
     }

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (140768 => 140769)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h	2013-01-25 03:43:29 UTC (rev 140768)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h	2013-01-25 03:47:28 UTC (rev 140769)
@@ -357,8 +357,8 @@
 
     bool windowIsFocused() const;
     bool windowAndWebPageAreFocused() const;
-    void installPageOverlay(PassRefPtr<PageOverlay>);
-    void uninstallPageOverlay(PageOverlay*, bool fadeOut);
+    void installPageOverlay(PassRefPtr<PageOverlay>, bool shouldFadeIn = false);
+    void uninstallPageOverlay(PageOverlay*, bool shouldFadeOut = false);
     bool hasPageOverlay() const { return m_pageOverlay; }
     WebCore::IntPoint screenToWindow(const WebCore::IntPoint&);
     WebCore::IntRect windowToScreen(const WebCore::IntRect&);

Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm (140768 => 140769)


--- trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm	2013-01-25 03:43:29 UTC (rev 140768)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm	2013-01-25 03:47:28 UTC (rev 140769)
@@ -490,7 +490,13 @@
 {
     ASSERT(m_pageOverlayLayer);
 
+    [CATransaction begin];
+    [CATransaction setDisableActions:YES];
+
     [m_pageOverlayLayer->platformLayer() removeFromSuperlayer];
+
+    [CATransaction commit];
+
     m_pageOverlayLayer = nullptr;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to