Changeset 116714 in webkit
- Timestamp:
- May 10, 2012 6:20:13 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r116712 r116714 1 2012-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 1 30 2012-05-10 Michael Nordman <michaeln@google.com> 2 31 -
trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp
r116594 r116714 601 601 602 602 bool addedAnimation = m_layerAnimationController->addAnimation(values, boxSize, animation, animationId, groupId, timeOffset); 603 if (addedAnimation) { 604 m_layerTreeHost->didAddAnimation(); 603 if (addedAnimation) 605 604 setNeedsCommit(); 606 }607 605 return addedAnimation; 608 606 } -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerAnimationController.cpp
r116594 r116714 282 282 // The new animation should be set to run as soon as possible. 283 283 toAdd->setRunState(CCActiveAnimation::WaitingForTargetAvailability, 0); 284 toAdd->setStartTime(0);285 284 controllerImpl->add(toAdd.release()); 286 285 } -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp
r116594 r116714 234 234 // We may have added an animation during the tree sync. This will cause both layer tree hosts 235 235 // to visit their controllers. 236 if (rootLayer() && m_needsAnimateLayers)236 if (rootLayer()) { 237 237 hostImpl->setNeedsAnimateLayers(); 238 m_needsAnimateLayers = true; 239 } 238 240 239 241 hostImpl->setSourceFrameNumber(frameNumber()); … … 336 338 ASSERT(CCThreadProxy::isMainThread()); 337 339 setAnimationEventsRecursive(*events, m_rootLayer.get(), wallClockTime); 338 }339 340 void CCLayerTreeHost::didAddAnimation()341 {342 m_needsAnimateLayers = true;343 m_proxy->didAddAnimation();344 340 } 345 341 … … 412 408 // We may have added an animation during the tree sync. This will cause both layer tree hosts 413 409 // to visit their controllers. 414 if (rootLayer() && m_needsAnimateLayers)410 if (rootLayer()) { 415 411 hostImpl->setNeedsAnimateLayers(); 412 m_needsAnimateLayers = true; 413 } 416 414 } 417 415 -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h
r116594 r116714 199 199 200 200 void setAnimationEvents(PassOwnPtr<CCAnimationEventsVector>, double wallClockTime); 201 void didAddAnimation();202 201 203 202 LayerChromium* rootLayer() { return m_rootLayer.get(); } -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp
r116594 r116714 120 120 , m_needsAnimateLayers(false) 121 121 , 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()))) 123 123 , m_fpsCounter(CCFrameRateCounter::create()) 124 124 , m_debugRectHistory(CCDebugRectHistory::create()) -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCProxy.h
r116594 r116714 87 87 virtual void setVisible(bool) = 0; 88 88 89 virtual void didAddAnimation() = 0;90 91 89 virtual bool commitRequested() const = 0; 92 90 -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp
r116594 r116714 33 33 #include "cc/CCLayerTreeHost.h" 34 34 #include "cc/CCTextureUpdater.h" 35 #include "cc/CCTimer.h"36 35 #include <wtf/CurrentTime.h> 37 36 … … 58 57 }; 59 58 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() OVERRIDE65 {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 82 59 PassOwnPtr<CCProxy> CCSingleThreadProxy::create(CCLayerTreeHost* layerTreeHost) 83 60 { … … 89 66 , m_contextLost(false) 90 67 , m_compositorIdentifier(-1) 91 , m_animationTimer(CCSingleThreadProxyAnimationTimer::create(this))92 68 , m_layerRendererInitialized(false) 93 69 , m_nextFrameIsNewlyCommittedFrame(false) … … 301 277 } 302 278 303 void CCSingleThreadProxy::didAddAnimation()304 {305 m_animationTimer->startOneShot(animationTimerDelay);306 }307 308 279 void CCSingleThreadProxy::stop() 309 280 { … … 375 346 ASSERT(!m_contextLost); 376 347 { 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); 393 363 } 394 364 -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.h
r116594 r116714 36 36 37 37 class CCLayerTreeHost; 38 class CCSingleThreadProxyAnimationTimer;39 38 40 39 class CCSingleThreadProxy : public CCProxy, CCLayerTreeHostImplClient { … … 61 60 virtual bool commitRequested() const OVERRIDE; 62 61 virtual void setVisible(bool) OVERRIDE; 63 virtual void didAddAnimation() OVERRIDE;64 62 virtual void start() OVERRIDE; 65 63 virtual void stop() OVERRIDE; … … 96 94 // be used for anything else. 97 95 RefPtr<GraphicsContext3D> m_contextBeforeInitialization; 98 99 OwnPtr<CCSingleThreadProxyAnimationTimer> m_animationTimer;100 96 101 97 // Used on the CCThread, but checked on main thread during initialization/shutdown. -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h
r116594 r116714 69 69 virtual bool commitRequested() const OVERRIDE; 70 70 virtual void setVisible(bool) OVERRIDE; 71 virtual void didAddAnimation() OVERRIDE { }72 71 virtual void start() OVERRIDE; 73 72 virtual void stop() OVERRIDE; -
trunk/Source/WebKit/chromium/ChangeLog
r116713 r116714 1 2012-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 1 14 2012-05-10 Jian Li <jianli@chromium.org> 2 15 -
trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp
r116613 r116714 1141 1141 virtual void animateLayers(CCLayerTreeHostImpl* layerTreeHostImpl, double monotonicTime) 1142 1142 { 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); 1148 1146 m_numAnimates++; 1149 1147 return; … … 1160 1158 }; 1161 1159 1162 SINGLE_AND_MULTI_THREAD_TEST_F(CCLayerTreeHostTestTickAnimationWhileBackgrounded) 1160 #if OS(WINDOWS) 1161 // http://webkit.org/b/74623 1162 TEST_F(CCLayerTreeHostTestTickAnimationWhileBackgrounded, FLAKY_runMultiThread) 1163 #else 1164 TEST_F(CCLayerTreeHostTestTickAnimationWhileBackgrounded, runMultiThread) 1165 #endif 1166 { 1167 runTestThreaded(); 1168 } 1163 1169 1164 1170 // Ensures that animations continue to be ticked when we are backgrounded. … … 1195 1201 }; 1196 1202 1197 SINGLE_AND_MULTI_THREAD_TEST_F(CCLayerTreeHostTestAddAnimationWithTimingFunction) 1203 #if OS(WINDOWS) 1204 // http://webkit.org/b/74623 1205 TEST_F(CCLayerTreeHostTestAddAnimationWithTimingFunction, FLAKY_runMultiThread) 1206 #else 1207 TEST_F(CCLayerTreeHostTestAddAnimationWithTimingFunction, runMultiThread) 1208 #endif 1209 { 1210 runTestThreaded(); 1211 } 1198 1212 1199 1213 // Ensures that when opacity is being animated, this value does not cause the subtree to be skipped. … … 1277 1291 }; 1278 1292 1279 SINGLE_AND_MULTI_THREAD_TEST_F(CCLayerTreeHostTestSynchronizeAnimationStartTimes) 1293 TEST_F(CCLayerTreeHostTestSynchronizeAnimationStartTimes, runMultiThread) 1294 { 1295 runTestThreaded(); 1296 } 1280 1297 1281 1298 // Ensures that main thread animations have their start times synchronized with impl thread animations. … … 1303 1320 }; 1304 1321 1305 SINGLE_AND_MULTI_THREAD_TEST_F(CCLayerTreeHostTestAnimationFinishedEvents) 1322 TEST_F(CCLayerTreeHostTestAnimationFinishedEvents, runMultiThread) 1323 { 1324 runTestThreaded(); 1325 } 1306 1326 1307 1327 class CCLayerTreeHostTestScrollSimple : public CCLayerTreeHostTestThreadOnly {
Note: See TracChangeset
for help on using the changeset viewer.