Title: [116714] trunk/Source
Revision
116714
Author
[email protected]
Date
2012-05-10 18:20:13 -0700 (Thu, 10 May 2012)

Log Message

Unreviewed, rolling out r116594.
http://trac.webkit.org/changeset/116594
https://bugs.webkit.org/show_bug.cgi?id=86013

r116594 might have made some composition tests flaky.

Source/WebCore:

* platform/graphics/chromium/LayerChromium.cpp:
(WebCore::LayerChromium::addAnimation):
* platform/graphics/chromium/cc/CCLayerAnimationController.cpp:
(WebCore::CCLayerAnimationController::pushNewAnimationsToImplThread):
* platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
(WebCore::CCLayerTreeHost::finishCommitOnImplThread):
(WebCore::CCLayerTreeHost::didBecomeInvisibleOnImplThread):
* platform/graphics/chromium/cc/CCLayerTreeHost.h:
(CCLayerTreeHost):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
(WebCore::CCLayerTreeHostImpl::CCLayerTreeHostImpl):
* platform/graphics/chromium/cc/CCProxy.h:
(CCProxy):
* platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
(WebCore::CCSingleThreadProxy::CCSingleThreadProxy):
(WebCore::CCSingleThreadProxy::doComposite):
* platform/graphics/chromium/cc/CCSingleThreadProxy.h:
(WebCore):
* platform/graphics/chromium/cc/CCThreadProxy.h:
(CCThreadProxy):

Source/WebKit/chromium:

* tests/CCLayerTreeHostTest.cpp:
(WTF::CCLayerTreeHostTestTickAnimationWhileBackgrounded::animateLayers):
(WTF):
(WTF::TEST_F):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (116713 => 116714)


--- trunk/Source/WebCore/ChangeLog	2012-05-11 01:08:35 UTC (rev 116713)
+++ trunk/Source/WebCore/ChangeLog	2012-05-11 01:20:13 UTC (rev 116714)
@@ -1,3 +1,32 @@
+2012-05-10  Kent Tamura  <[email protected]>
+
+        Unreviewed, rolling out r116594.
+        http://trac.webkit.org/changeset/116594
+        https://bugs.webkit.org/show_bug.cgi?id=86013
+
+        r116594 might have made some composition tests flaky.
+
+        * platform/graphics/chromium/LayerChromium.cpp:
+        (WebCore::LayerChromium::addAnimation):
+        * platform/graphics/chromium/cc/CCLayerAnimationController.cpp:
+        (WebCore::CCLayerAnimationController::pushNewAnimationsToImplThread):
+        * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
+        (WebCore::CCLayerTreeHost::finishCommitOnImplThread):
+        (WebCore::CCLayerTreeHost::didBecomeInvisibleOnImplThread):
+        * platform/graphics/chromium/cc/CCLayerTreeHost.h:
+        (CCLayerTreeHost):
+        * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
+        (WebCore::CCLayerTreeHostImpl::CCLayerTreeHostImpl):
+        * platform/graphics/chromium/cc/CCProxy.h:
+        (CCProxy):
+        * platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
+        (WebCore::CCSingleThreadProxy::CCSingleThreadProxy):
+        (WebCore::CCSingleThreadProxy::doComposite):
+        * platform/graphics/chromium/cc/CCSingleThreadProxy.h:
+        (WebCore):
+        * platform/graphics/chromium/cc/CCThreadProxy.h:
+        (CCThreadProxy):
+
 2012-05-10  Michael Nordman  <[email protected]>
 
         [chromium] DomStorage events handling needs TLC (2)

Modified: trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp (116713 => 116714)


--- trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp	2012-05-11 01:08:35 UTC (rev 116713)
+++ trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp	2012-05-11 01:20:13 UTC (rev 116714)
@@ -600,10 +600,8 @@
         return false;
 
     bool addedAnimation = m_layerAnimationController->addAnimation(values, boxSize, animation, animationId, groupId, timeOffset);
-    if (addedAnimation) {
-        m_layerTreeHost->didAddAnimation();
+    if (addedAnimation)
         setNeedsCommit();
-    }
     return addedAnimation;
 }
 

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerAnimationController.cpp (116713 => 116714)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerAnimationController.cpp	2012-05-11 01:08:35 UTC (rev 116713)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerAnimationController.cpp	2012-05-11 01:20:13 UTC (rev 116714)
@@ -281,7 +281,6 @@
         ASSERT(!toAdd->needsSynchronizedStartTime());
         // The new animation should be set to run as soon as possible.
         toAdd->setRunState(CCActiveAnimation::WaitingForTargetAvailability, 0);
-        toAdd->setStartTime(0);
         controllerImpl->add(toAdd.release());
     }
 }

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp (116713 => 116714)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp	2012-05-11 01:08:35 UTC (rev 116713)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp	2012-05-11 01:20:13 UTC (rev 116714)
@@ -233,8 +233,10 @@
 
     // We may have added an animation during the tree sync. This will cause both layer tree hosts
     // to visit their controllers.
-    if (rootLayer() && m_needsAnimateLayers)
+    if (rootLayer()) {
         hostImpl->setNeedsAnimateLayers();
+        m_needsAnimateLayers = true;
+    }
 
     hostImpl->setSourceFrameNumber(frameNumber());
     hostImpl->setViewportSize(viewportSize());
@@ -337,12 +339,6 @@
     setAnimationEventsRecursive(*events, m_rootLayer.get(), wallClockTime);
 }
 
-void CCLayerTreeHost::didAddAnimation()
-{
-    m_needsAnimateLayers = true;
-    m_proxy->didAddAnimation();
-}
-
 void CCLayerTreeHost::setRootLayer(PassRefPtr<LayerChromium> rootLayer)
 {
     if (m_rootLayer == rootLayer)
@@ -411,8 +407,10 @@
 
     // We may have added an animation during the tree sync. This will cause both layer tree hosts
     // to visit their controllers.
-    if (rootLayer() && m_needsAnimateLayers)
+    if (rootLayer()) {
         hostImpl->setNeedsAnimateLayers();
+        m_needsAnimateLayers = true;
+    }
 }
 
 void CCLayerTreeHost::setContentsMemoryAllocationLimitBytes(size_t bytes)

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h (116713 => 116714)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h	2012-05-11 01:08:35 UTC (rev 116713)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h	2012-05-11 01:20:13 UTC (rev 116714)
@@ -198,7 +198,6 @@
     bool commitRequested() const;
 
     void setAnimationEvents(PassOwnPtr<CCAnimationEventsVector>, double wallClockTime);
-    void didAddAnimation();
 
     LayerChromium* rootLayer() { return m_rootLayer.get(); }
     const LayerChromium* rootLayer() const { return m_rootLayer.get(); }

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp (116713 => 116714)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp	2012-05-11 01:08:35 UTC (rev 116713)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp	2012-05-11 01:20:13 UTC (rev 116714)
@@ -119,7 +119,7 @@
     , m_maxPageScale(0)
     , m_needsAnimateLayers(false)
     , m_pinchGestureActive(false)
-    , m_timeSourceClientAdapter(CCLayerTreeHostImplTimeSourceAdapter::create(this, CCDelayBasedTimeSource::create(lowFrequencyAnimationInterval, CCProxy::currentThread())))
+    , m_timeSourceClientAdapter(CCLayerTreeHostImplTimeSourceAdapter::create(this, CCDelayBasedTimeSource::create(lowFrequencyAnimationInterval * 1000.0, CCProxy::currentThread())))
     , m_fpsCounter(CCFrameRateCounter::create())
     , m_debugRectHistory(CCDebugRectHistory::create())
 {

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCProxy.h (116713 => 116714)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCProxy.h	2012-05-11 01:08:35 UTC (rev 116713)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCProxy.h	2012-05-11 01:20:13 UTC (rev 116714)
@@ -86,8 +86,6 @@
     virtual void setNeedsRedraw() = 0;
     virtual void setVisible(bool) = 0;
 
-    virtual void didAddAnimation() = 0;
-
     virtual bool commitRequested() const = 0;
 
     virtual void start() = 0; // Must be called before using the proxy.

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp (116713 => 116714)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp	2012-05-11 01:08:35 UTC (rev 116713)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp	2012-05-11 01:20:13 UTC (rev 116714)
@@ -32,7 +32,6 @@
 #include "cc/CCFontAtlas.h"
 #include "cc/CCLayerTreeHost.h"
 #include "cc/CCTextureUpdater.h"
-#include "cc/CCTimer.h"
 #include <wtf/CurrentTime.h>
 
 using namespace WTF;
@@ -57,28 +56,6 @@
     UnthrottledTextureUploader() { }
 };
 
-class CCSingleThreadProxyAnimationTimer : public CCTimer, CCTimerClient {
-public:
-    static PassOwnPtr<CCSingleThreadProxyAnimationTimer> create(CCSingleThreadProxy* proxy) { return adoptPtr(new CCSingleThreadProxyAnimationTimer(proxy)); }
-
-    virtual void onTimerFired() OVERRIDE
-    {
-        m_proxy->compositeImmediately();
-    }
-
-private:
-    explicit CCSingleThreadProxyAnimationTimer(CCSingleThreadProxy* proxy)
-        : CCTimer(CCProxy::mainThread(), this)
-        , m_proxy(proxy)
-    {
-    }
-
-    CCSingleThreadProxy* m_proxy;
-};
-
-// Measured in seconds.
-static const double animationTimerDelay = 1 / 60.0;
-
 PassOwnPtr<CCProxy> CCSingleThreadProxy::create(CCLayerTreeHost* layerTreeHost)
 {
     return adoptPtr(new CCSingleThreadProxy(layerTreeHost));
@@ -88,7 +65,6 @@
     : m_layerTreeHost(layerTreeHost)
     , m_contextLost(false)
     , m_compositorIdentifier(-1)
-    , m_animationTimer(CCSingleThreadProxyAnimationTimer::create(this))
     , m_layerRendererInitialized(false)
     , m_nextFrameIsNewlyCommittedFrame(false)
 {
@@ -300,11 +276,6 @@
     setNeedsCommit();
 }
 
-void CCSingleThreadProxy::didAddAnimation()
-{
-    m_animationTimer->startOneShot(animationTimerDelay);
-}
-
 void CCSingleThreadProxy::stop()
 {
     TRACE_EVENT("CCSingleThreadProxy::stop", this, 0);
@@ -374,22 +345,21 @@
 {
     ASSERT(!m_contextLost);
     {
-        DebugScopedSetImplThread impl;
-        double monotonicTime = monotonicallyIncreasingTime();
-        double wallClockTime = currentTime();
+      DebugScopedSetImplThread impl;
+      double monotonicTime = monotonicallyIncreasingTime();
+      double wallClockTime = currentTime();
+      m_layerTreeHostImpl->animate(monotonicTime, wallClockTime);
 
-        m_layerTreeHostImpl->animate(monotonicTime, wallClockTime);
+      // We guard prepareToDraw() with canDraw() because it always returns a valid frame, so can only
+      // be used when such a frame is possible. Since drawLayers() depends on the result of
+      // prepareToDraw(), it is guarded on canDraw() as well.
+      if (!m_layerTreeHostImpl->canDraw())
+          return false;
 
-        // We guard prepareToDraw() with canDraw() because it always returns a valid frame, so can only
-        // be used when such a frame is possible. Since drawLayers() depends on the result of
-        // prepareToDraw(), it is guarded on canDraw() as well.
-        if (!m_layerTreeHostImpl->canDraw() || !m_layerTreeHostImpl->visible())
-            return false;
-
-        CCLayerTreeHostImpl::FrameData frame;
-        m_layerTreeHostImpl->prepareToDraw(frame);
-        m_layerTreeHostImpl->drawLayers(frame);
-        m_layerTreeHostImpl->didDrawAllLayers(frame);
+      CCLayerTreeHostImpl::FrameData frame;
+      m_layerTreeHostImpl->prepareToDraw(frame);
+      m_layerTreeHostImpl->drawLayers(frame);
+      m_layerTreeHostImpl->didDrawAllLayers(frame);
     }
 
     if (m_layerTreeHostImpl->isContextLost()) {

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.h (116713 => 116714)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.h	2012-05-11 01:08:35 UTC (rev 116713)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.h	2012-05-11 01:20:13 UTC (rev 116714)
@@ -35,7 +35,6 @@
 namespace WebCore {
 
 class CCLayerTreeHost;
-class CCSingleThreadProxyAnimationTimer;
 
 class CCSingleThreadProxy : public CCProxy, CCLayerTreeHostImplClient {
 public:
@@ -60,7 +59,6 @@
     virtual void setNeedsRedraw() OVERRIDE;
     virtual bool commitRequested() const OVERRIDE;
     virtual void setVisible(bool) OVERRIDE;
-    virtual void didAddAnimation() OVERRIDE;
     virtual void start() OVERRIDE;
     virtual void stop() OVERRIDE;
     virtual size_t maxPartialTextureUpdates() const OVERRIDE { return std::numeric_limits<size_t>::max(); }
@@ -96,8 +94,6 @@
     // be used for anything else.
     RefPtr<GraphicsContext3D> m_contextBeforeInitialization;
 
-    OwnPtr<CCSingleThreadProxyAnimationTimer> m_animationTimer;
-
     // Used on the CCThread, but checked on main thread during initialization/shutdown.
     OwnPtr<CCLayerTreeHostImpl> m_layerTreeHostImpl;
     bool m_layerRendererInitialized;

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h (116713 => 116714)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h	2012-05-11 01:08:35 UTC (rev 116713)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h	2012-05-11 01:20:13 UTC (rev 116714)
@@ -68,7 +68,6 @@
     virtual void setNeedsRedraw() OVERRIDE;
     virtual bool commitRequested() const OVERRIDE;
     virtual void setVisible(bool) OVERRIDE;
-    virtual void didAddAnimation() OVERRIDE { }
     virtual void start() OVERRIDE;
     virtual void stop() OVERRIDE;
     virtual size_t maxPartialTextureUpdates() const OVERRIDE;

Modified: trunk/Source/WebKit/chromium/ChangeLog (116713 => 116714)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-05-11 01:08:35 UTC (rev 116713)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-05-11 01:20:13 UTC (rev 116714)
@@ -1,3 +1,16 @@
+2012-05-10  Kent Tamura  <[email protected]>
+
+        Unreviewed, rolling out r116594.
+        http://trac.webkit.org/changeset/116594
+        https://bugs.webkit.org/show_bug.cgi?id=86013
+
+        r116594 might have made some composition tests flaky.
+
+        * tests/CCLayerTreeHostTest.cpp:
+        (WTF::CCLayerTreeHostTestTickAnimationWhileBackgrounded::animateLayers):
+        (WTF):
+        (WTF::TEST_F):
+
 2012-05-10  Jian Li  <[email protected]>
 
         Unreviewed. Fix chromium build break.

Modified: trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp (116713 => 116714)


--- trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp	2012-05-11 01:08:35 UTC (rev 116713)
+++ trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp	2012-05-11 01:20:13 UTC (rev 116714)
@@ -1140,11 +1140,9 @@
 
     virtual void animateLayers(CCLayerTreeHostImpl* layerTreeHostImpl, double monotonicTime)
     {
-        if (m_numAnimates < 2) {
-            if (!m_numAnimates) {
-                // We have a long animation running. It should continue to tick even if we are not visible.
-                postSetVisibleToMainThread(false);
-            }
+        if (!m_numAnimates) {
+            // We have a long animation running. It should continue to tick even if we are not visible.
+            postSetVisibleToMainThread(false);
             m_numAnimates++;
             return;
         }
@@ -1159,7 +1157,15 @@
     int m_numAnimates;
 };
 
-SINGLE_AND_MULTI_THREAD_TEST_F(CCLayerTreeHostTestTickAnimationWhileBackgrounded)
+#if OS(WINDOWS)
+// http://webkit.org/b/74623
+TEST_F(CCLayerTreeHostTestTickAnimationWhileBackgrounded, FLAKY_runMultiThread)
+#else
+TEST_F(CCLayerTreeHostTestTickAnimationWhileBackgrounded, runMultiThread)
+#endif
+{
+    runTestThreaded();
+}
 
 // Ensures that animations continue to be ticked when we are backgrounded.
 class CCLayerTreeHostTestAddAnimationWithTimingFunction : public CCLayerTreeHostTestThreadOnly {
@@ -1194,7 +1200,15 @@
 private:
 };
 
-SINGLE_AND_MULTI_THREAD_TEST_F(CCLayerTreeHostTestAddAnimationWithTimingFunction)
+#if OS(WINDOWS)
+// http://webkit.org/b/74623
+TEST_F(CCLayerTreeHostTestAddAnimationWithTimingFunction, FLAKY_runMultiThread)
+#else
+TEST_F(CCLayerTreeHostTestAddAnimationWithTimingFunction, runMultiThread)
+#endif
+{
+    runTestThreaded();
+}
 
 // Ensures that when opacity is being animated, this value does not cause the subtree to be skipped.
 class CCLayerTreeHostTestDoNotSkipLayersWithAnimatedOpacity : public CCLayerTreeHostTestThreadOnly {
@@ -1276,7 +1290,10 @@
     CCLayerTreeHostImpl* m_layerTreeHostImpl;
 };
 
-SINGLE_AND_MULTI_THREAD_TEST_F(CCLayerTreeHostTestSynchronizeAnimationStartTimes)
+TEST_F(CCLayerTreeHostTestSynchronizeAnimationStartTimes, runMultiThread)
+{
+    runTestThreaded();
+}
 
 // Ensures that main thread animations have their start times synchronized with impl thread animations.
 class CCLayerTreeHostTestAnimationFinishedEvents : public CCLayerTreeHostTestThreadOnly {
@@ -1302,7 +1319,10 @@
 private:
 };
 
-SINGLE_AND_MULTI_THREAD_TEST_F(CCLayerTreeHostTestAnimationFinishedEvents)
+TEST_F(CCLayerTreeHostTestAnimationFinishedEvents, runMultiThread)
+{
+    runTestThreaded();
+}
 
 class CCLayerTreeHostTestScrollSimple : public CCLayerTreeHostTestThreadOnly {
 public:
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to