Title: [148512] trunk/Source/WebKit/blackberry
Revision
148512
Author
[email protected]
Date
2013-04-16 08:07:18 -0700 (Tue, 16 Apr 2013)

Log Message

[BlackBerry] Accelerated animation regression with GL renderer
https://bugs.webkit.org/show_bug.cgi?id=114685

Reviewed by Rob Buis.

Internally reviewed by Filip Spacek.

GL renderer changed the assumption made in accelerated animation
code that rendering the contents of AC layer tiles would be the
slow operation. By starting animations after the slow operation,
the appearance of the animation could be made smooth.

Rendering tiles may still be slow, but now something else can be
slow too: drawing display lists to backing. And it's running on
the compositing thread, can happen at any time and will interrupt
accelerated animations.

Improved the situation by calling an API for updating backing to
schedule the delay at a convenient time. We try to update backing
before starting animations. However, future backing updates can
still interrupt the running animation and cause dropped frames.

Further improvements to animation smoothness will probably require
optimizations in the GL renderer.

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::WebPagePrivate):
(BlackBerry::WebKit::WebPagePrivate::commitRootLayer):
(BlackBerry::WebKit::WebPagePrivate::commitRootLayerIfNeeded):
* Api/WebPage_p.h:
(WebPagePrivate):
* WebKitSupport/FrameLayers.cpp:
(BlackBerry::WebKit::FrameLayers::notifyAnimationsStarted):
(WebKit):
* WebKitSupport/FrameLayers.h:
(FrameLayers):

Modified Paths

Diff

Modified: trunk/Source/WebKit/blackberry/Api/WebPage.cpp (148511 => 148512)


--- trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2013-04-16 12:59:15 UTC (rev 148511)
+++ trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2013-04-16 15:07:18 UTC (rev 148512)
@@ -429,6 +429,8 @@
 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     , m_notificationManager(this)
 #endif
+    , m_didStartAnimations(false)
+    , m_animationStartTime(0)
 {
     static bool isInitialized = false;
     if (!isInitialized) {
@@ -5375,10 +5377,16 @@
 
     if (rootLayer)
         rootLayer->commitOnCompositingThread();
-
     if (overlayLayer)
         overlayLayer->commitOnCompositingThread();
 
+    m_animationStartTime = currentTime();
+    m_didStartAnimations = false;
+    if (rootLayer)
+        m_didStartAnimations |= rootLayer->startAnimations(m_animationStartTime);
+    if (overlayLayer)
+        m_didStartAnimations |= overlayLayer->startAnimations(m_animationStartTime);
+
     scheduleCompositingRun();
 }
 
@@ -5456,6 +5464,15 @@
             documentRect,
             drawsRootLayer));
 
+    if (m_didStartAnimations) {
+        if (m_frameLayers && m_frameLayers->hasLayer())
+            m_frameLayers->notifyAnimationsStarted(m_animationStartTime);
+        if (m_overlayLayer)
+            m_overlayLayer->platformLayer()->notifyAnimationsStarted(m_animationStartTime);
+
+        m_didStartAnimations = false;
+    }
+
     didComposite();
     return true;
 }

Modified: trunk/Source/WebKit/blackberry/Api/WebPage_p.h (148511 => 148512)


--- trunk/Source/WebKit/blackberry/Api/WebPage_p.h	2013-04-16 12:59:15 UTC (rev 148511)
+++ trunk/Source/WebKit/blackberry/Api/WebPage_p.h	2013-04-16 15:07:18 UTC (rev 148512)
@@ -636,6 +636,9 @@
     NotificationManager m_notificationManager;
 #endif
 
+    bool m_didStartAnimations;
+    double m_animationStartTime;
+
 protected:
     virtual ~WebPagePrivate();
 };

Modified: trunk/Source/WebKit/blackberry/ChangeLog (148511 => 148512)


--- trunk/Source/WebKit/blackberry/ChangeLog	2013-04-16 12:59:15 UTC (rev 148511)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2013-04-16 15:07:18 UTC (rev 148512)
@@ -1,3 +1,42 @@
+2013-04-16  Arvid Nilsson  <[email protected]>
+
+        [BlackBerry] Accelerated animation regression with GL renderer
+        https://bugs.webkit.org/show_bug.cgi?id=114685
+
+        Reviewed by Rob Buis.
+
+        Internally reviewed by Filip Spacek.
+
+        GL renderer changed the assumption made in accelerated animation
+        code that rendering the contents of AC layer tiles would be the
+        slow operation. By starting animations after the slow operation,
+        the appearance of the animation could be made smooth.
+
+        Rendering tiles may still be slow, but now something else can be
+        slow too: drawing display lists to backing. And it's running on
+        the compositing thread, can happen at any time and will interrupt
+        accelerated animations.
+
+        Improved the situation by calling an API for updating backing to
+        schedule the delay at a convenient time. We try to update backing
+        before starting animations. However, future backing updates can
+        still interrupt the running animation and cause dropped frames.
+
+        Further improvements to animation smoothness will probably require
+        optimizations in the GL renderer.
+
+        * Api/WebPage.cpp:
+        (BlackBerry::WebKit::WebPagePrivate::WebPagePrivate):
+        (BlackBerry::WebKit::WebPagePrivate::commitRootLayer):
+        (BlackBerry::WebKit::WebPagePrivate::commitRootLayerIfNeeded):
+        * Api/WebPage_p.h:
+        (WebPagePrivate):
+        * WebKitSupport/FrameLayers.cpp:
+        (BlackBerry::WebKit::FrameLayers::notifyAnimationsStarted):
+        (WebKit):
+        * WebKitSupport/FrameLayers.h:
+        (FrameLayers):
+
 2013-04-15  Liam Quinn  <[email protected]>
 
         [BlackBerry] Crash from null m_webSettings in WebPagePrivate

Modified: trunk/Source/WebKit/blackberry/WebKitSupport/FrameLayers.cpp (148511 => 148512)


--- trunk/Source/WebKit/blackberry/WebKitSupport/FrameLayers.cpp	2013-04-16 12:59:15 UTC (rev 148511)
+++ trunk/Source/WebKit/blackberry/WebKitSupport/FrameLayers.cpp	2013-04-16 15:07:18 UTC (rev 148512)
@@ -109,6 +109,11 @@
     m_rootLayer->commitOnWebKitThread(scale);
 }
 
+void FrameLayers::notifyAnimationsStarted(double animationStartTime)
+{
+    m_rootLayer->notifyAnimationsStarted(animationStartTime);
+}
+
 void FrameLayers::calculateRootLayer()
 {
     if (m_frameLayers.size() == 1 && m_frameLayers.begin()->key == m_pagePrivate->m_mainFrame)

Modified: trunk/Source/WebKit/blackberry/WebKitSupport/FrameLayers.h (148511 => 148512)


--- trunk/Source/WebKit/blackberry/WebKitSupport/FrameLayers.h	2013-04-16 12:59:15 UTC (rev 148511)
+++ trunk/Source/WebKit/blackberry/WebKitSupport/FrameLayers.h	2013-04-16 15:07:18 UTC (rev 148512)
@@ -48,6 +48,7 @@
     bool hasLayer() const { return m_frameLayers.size(); }
 
     void commitOnWebKitThread(double scale);
+    void notifyAnimationsStarted(double animationStartTime);
 
     void calculateRootLayer();
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to