Changeset 116714 in webkit


Ignore:
Timestamp:
May 10, 2012 6:20:13 PM (12 years ago)
Author:
tkent@chromium.org
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):

Location:
trunk/Source
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r116712 r116714  
     12012-05-10  Kent Tamura  <tkent@chromium.org>
     2
     3        Unreviewed, rolling out r116594.
     4        http://trac.webkit.org/changeset/116594
     5        https://bugs.webkit.org/show_bug.cgi?id=86013
     6
     7        r116594 might have made some composition tests flaky.
     8
     9        * platform/graphics/chromium/LayerChromium.cpp:
     10        (WebCore::LayerChromium::addAnimation):
     11        * platform/graphics/chromium/cc/CCLayerAnimationController.cpp:
     12        (WebCore::CCLayerAnimationController::pushNewAnimationsToImplThread):
     13        * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
     14        (WebCore::CCLayerTreeHost::finishCommitOnImplThread):
     15        (WebCore::CCLayerTreeHost::didBecomeInvisibleOnImplThread):
     16        * platform/graphics/chromium/cc/CCLayerTreeHost.h:
     17        (CCLayerTreeHost):
     18        * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
     19        (WebCore::CCLayerTreeHostImpl::CCLayerTreeHostImpl):
     20        * platform/graphics/chromium/cc/CCProxy.h:
     21        (CCProxy):
     22        * platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
     23        (WebCore::CCSingleThreadProxy::CCSingleThreadProxy):
     24        (WebCore::CCSingleThreadProxy::doComposite):
     25        * platform/graphics/chromium/cc/CCSingleThreadProxy.h:
     26        (WebCore):
     27        * platform/graphics/chromium/cc/CCThreadProxy.h:
     28        (CCThreadProxy):
     29
    1302012-05-10  Michael Nordman  <michaeln@google.com>
    231
  • trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp

    r116594 r116714  
    601601
    602602    bool addedAnimation = m_layerAnimationController->addAnimation(values, boxSize, animation, animationId, groupId, timeOffset);
    603     if (addedAnimation) {
    604         m_layerTreeHost->didAddAnimation();
     603    if (addedAnimation)
    605604        setNeedsCommit();
    606     }
    607605    return addedAnimation;
    608606}
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerAnimationController.cpp

    r116594 r116714  
    282282        // The new animation should be set to run as soon as possible.
    283283        toAdd->setRunState(CCActiveAnimation::WaitingForTargetAvailability, 0);
    284         toAdd->setStartTime(0);
    285284        controllerImpl->add(toAdd.release());
    286285    }
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp

    r116594 r116714  
    234234    // We may have added an animation during the tree sync. This will cause both layer tree hosts
    235235    // to visit their controllers.
    236     if (rootLayer() && m_needsAnimateLayers)
     236    if (rootLayer()) {
    237237        hostImpl->setNeedsAnimateLayers();
     238        m_needsAnimateLayers = true;
     239    }
    238240
    239241    hostImpl->setSourceFrameNumber(frameNumber());
     
    336338    ASSERT(CCThreadProxy::isMainThread());
    337339    setAnimationEventsRecursive(*events, m_rootLayer.get(), wallClockTime);
    338 }
    339 
    340 void CCLayerTreeHost::didAddAnimation()
    341 {
    342     m_needsAnimateLayers = true;
    343     m_proxy->didAddAnimation();
    344340}
    345341
     
    412408    // We may have added an animation during the tree sync. This will cause both layer tree hosts
    413409    // to visit their controllers.
    414     if (rootLayer() && m_needsAnimateLayers)
     410    if (rootLayer()) {
    415411        hostImpl->setNeedsAnimateLayers();
     412        m_needsAnimateLayers = true;
     413    }
    416414}
    417415
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h

    r116594 r116714  
    199199
    200200    void setAnimationEvents(PassOwnPtr<CCAnimationEventsVector>, double wallClockTime);
    201     void didAddAnimation();
    202201
    203202    LayerChromium* rootLayer() { return m_rootLayer.get(); }
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp

    r116594 r116714  
    120120    , m_needsAnimateLayers(false)
    121121    , m_pinchGestureActive(false)
    122     , m_timeSourceClientAdapter(CCLayerTreeHostImplTimeSourceAdapter::create(this, CCDelayBasedTimeSource::create(lowFrequencyAnimationInterval, CCProxy::currentThread())))
     122    , m_timeSourceClientAdapter(CCLayerTreeHostImplTimeSourceAdapter::create(this, CCDelayBasedTimeSource::create(lowFrequencyAnimationInterval * 1000.0, CCProxy::currentThread())))
    123123    , m_fpsCounter(CCFrameRateCounter::create())
    124124    , m_debugRectHistory(CCDebugRectHistory::create())
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCProxy.h

    r116594 r116714  
    8787    virtual void setVisible(bool) = 0;
    8888
    89     virtual void didAddAnimation() = 0;
    90 
    9189    virtual bool commitRequested() const = 0;
    9290
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp

    r116594 r116714  
    3333#include "cc/CCLayerTreeHost.h"
    3434#include "cc/CCTextureUpdater.h"
    35 #include "cc/CCTimer.h"
    3635#include <wtf/CurrentTime.h>
    3736
     
    5857};
    5958
    60 class CCSingleThreadProxyAnimationTimer : public CCTimer, CCTimerClient {
    61 public:
    62     static PassOwnPtr<CCSingleThreadProxyAnimationTimer> create(CCSingleThreadProxy* proxy) { return adoptPtr(new CCSingleThreadProxyAnimationTimer(proxy)); }
    63 
    64     virtual void onTimerFired() OVERRIDE
    65     {
    66         m_proxy->compositeImmediately();
    67     }
    68 
    69 private:
    70     explicit CCSingleThreadProxyAnimationTimer(CCSingleThreadProxy* proxy)
    71         : CCTimer(CCProxy::mainThread(), this)
    72         , m_proxy(proxy)
    73     {
    74     }
    75 
    76     CCSingleThreadProxy* m_proxy;
    77 };
    78 
    79 // Measured in seconds.
    80 static const double animationTimerDelay = 1 / 60.0;
    81 
    8259PassOwnPtr<CCProxy> CCSingleThreadProxy::create(CCLayerTreeHost* layerTreeHost)
    8360{
     
    8966    , m_contextLost(false)
    9067    , m_compositorIdentifier(-1)
    91     , m_animationTimer(CCSingleThreadProxyAnimationTimer::create(this))
    9268    , m_layerRendererInitialized(false)
    9369    , m_nextFrameIsNewlyCommittedFrame(false)
     
    301277}
    302278
    303 void CCSingleThreadProxy::didAddAnimation()
    304 {
    305     m_animationTimer->startOneShot(animationTimerDelay);
    306 }
    307 
    308279void CCSingleThreadProxy::stop()
    309280{
     
    375346    ASSERT(!m_contextLost);
    376347    {
    377         DebugScopedSetImplThread impl;
    378         double monotonicTime = monotonicallyIncreasingTime();
    379         double wallClockTime = currentTime();
    380 
    381         m_layerTreeHostImpl->animate(monotonicTime, wallClockTime);
    382 
    383         // We guard prepareToDraw() with canDraw() because it always returns a valid frame, so can only
    384         // be used when such a frame is possible. Since drawLayers() depends on the result of
    385         // prepareToDraw(), it is guarded on canDraw() as well.
    386         if (!m_layerTreeHostImpl->canDraw() || !m_layerTreeHostImpl->visible())
    387             return false;
    388 
    389         CCLayerTreeHostImpl::FrameData frame;
    390         m_layerTreeHostImpl->prepareToDraw(frame);
    391         m_layerTreeHostImpl->drawLayers(frame);
    392         m_layerTreeHostImpl->didDrawAllLayers(frame);
     348      DebugScopedSetImplThread impl;
     349      double monotonicTime = monotonicallyIncreasingTime();
     350      double wallClockTime = currentTime();
     351      m_layerTreeHostImpl->animate(monotonicTime, wallClockTime);
     352
     353      // We guard prepareToDraw() with canDraw() because it always returns a valid frame, so can only
     354      // be used when such a frame is possible. Since drawLayers() depends on the result of
     355      // prepareToDraw(), it is guarded on canDraw() as well.
     356      if (!m_layerTreeHostImpl->canDraw())
     357          return false;
     358
     359      CCLayerTreeHostImpl::FrameData frame;
     360      m_layerTreeHostImpl->prepareToDraw(frame);
     361      m_layerTreeHostImpl->drawLayers(frame);
     362      m_layerTreeHostImpl->didDrawAllLayers(frame);
    393363    }
    394364
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.h

    r116594 r116714  
    3636
    3737class CCLayerTreeHost;
    38 class CCSingleThreadProxyAnimationTimer;
    3938
    4039class CCSingleThreadProxy : public CCProxy, CCLayerTreeHostImplClient {
     
    6160    virtual bool commitRequested() const OVERRIDE;
    6261    virtual void setVisible(bool) OVERRIDE;
    63     virtual void didAddAnimation() OVERRIDE;
    6462    virtual void start() OVERRIDE;
    6563    virtual void stop() OVERRIDE;
     
    9694    // be used for anything else.
    9795    RefPtr<GraphicsContext3D> m_contextBeforeInitialization;
    98 
    99     OwnPtr<CCSingleThreadProxyAnimationTimer> m_animationTimer;
    10096
    10197    // Used on the CCThread, but checked on main thread during initialization/shutdown.
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h

    r116594 r116714  
    6969    virtual bool commitRequested() const OVERRIDE;
    7070    virtual void setVisible(bool) OVERRIDE;
    71     virtual void didAddAnimation() OVERRIDE { }
    7271    virtual void start() OVERRIDE;
    7372    virtual void stop() OVERRIDE;
  • trunk/Source/WebKit/chromium/ChangeLog

    r116713 r116714  
     12012-05-10  Kent Tamura  <tkent@chromium.org>
     2
     3        Unreviewed, rolling out r116594.
     4        http://trac.webkit.org/changeset/116594
     5        https://bugs.webkit.org/show_bug.cgi?id=86013
     6
     7        r116594 might have made some composition tests flaky.
     8
     9        * tests/CCLayerTreeHostTest.cpp:
     10        (WTF::CCLayerTreeHostTestTickAnimationWhileBackgrounded::animateLayers):
     11        (WTF):
     12        (WTF::TEST_F):
     13
    1142012-05-10  Jian Li  <jianli@chromium.org>
    215
  • trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp

    r116613 r116714  
    11411141    virtual void animateLayers(CCLayerTreeHostImpl* layerTreeHostImpl, double monotonicTime)
    11421142    {
    1143         if (m_numAnimates < 2) {
    1144             if (!m_numAnimates) {
    1145                 // We have a long animation running. It should continue to tick even if we are not visible.
    1146                 postSetVisibleToMainThread(false);
    1147             }
     1143        if (!m_numAnimates) {
     1144            // We have a long animation running. It should continue to tick even if we are not visible.
     1145            postSetVisibleToMainThread(false);
    11481146            m_numAnimates++;
    11491147            return;
     
    11601158};
    11611159
    1162 SINGLE_AND_MULTI_THREAD_TEST_F(CCLayerTreeHostTestTickAnimationWhileBackgrounded)
     1160#if OS(WINDOWS)
     1161// http://webkit.org/b/74623
     1162TEST_F(CCLayerTreeHostTestTickAnimationWhileBackgrounded, FLAKY_runMultiThread)
     1163#else
     1164TEST_F(CCLayerTreeHostTestTickAnimationWhileBackgrounded, runMultiThread)
     1165#endif
     1166{
     1167    runTestThreaded();
     1168}
    11631169
    11641170// Ensures that animations continue to be ticked when we are backgrounded.
     
    11951201};
    11961202
    1197 SINGLE_AND_MULTI_THREAD_TEST_F(CCLayerTreeHostTestAddAnimationWithTimingFunction)
     1203#if OS(WINDOWS)
     1204// http://webkit.org/b/74623
     1205TEST_F(CCLayerTreeHostTestAddAnimationWithTimingFunction, FLAKY_runMultiThread)
     1206#else
     1207TEST_F(CCLayerTreeHostTestAddAnimationWithTimingFunction, runMultiThread)
     1208#endif
     1209{
     1210    runTestThreaded();
     1211}
    11981212
    11991213// Ensures that when opacity is being animated, this value does not cause the subtree to be skipped.
     
    12771291};
    12781292
    1279 SINGLE_AND_MULTI_THREAD_TEST_F(CCLayerTreeHostTestSynchronizeAnimationStartTimes)
     1293TEST_F(CCLayerTreeHostTestSynchronizeAnimationStartTimes, runMultiThread)
     1294{
     1295    runTestThreaded();
     1296}
    12801297
    12811298// Ensures that main thread animations have their start times synchronized with impl thread animations.
     
    13031320};
    13041321
    1305 SINGLE_AND_MULTI_THREAD_TEST_F(CCLayerTreeHostTestAnimationFinishedEvents)
     1322TEST_F(CCLayerTreeHostTestAnimationFinishedEvents, runMultiThread)
     1323{
     1324    runTestThreaded();
     1325}
    13061326
    13071327class CCLayerTreeHostTestScrollSimple : public CCLayerTreeHostTestThreadOnly {
Note: See TracChangeset for help on using the changeset viewer.