Title: [113346] trunk/Source/WebKit/chromium
Revision
113346
Author
commit-qu...@webkit.org
Date
2012-04-05 11:57:57 -0700 (Thu, 05 Apr 2012)

Log Message

[chromium] Race condition in CCLayerTreeHostTestSynchronizeAnimationStartTimes
https://bugs.webkit.org/show_bug.cgi?id=83179

Patch by Ian Vollick <voll...@chromium.org> on 2012-04-05
Reviewed by James Robinson.

* tests/CCLayerTreeHostTest.cpp:
(WTF::TestHooks::willAnimateLayers):
(WTF::MockLayerTreeHostImpl::animateLayers):
(WTF::CCLayerTreeHostTestSynchronizeAnimationStartTimes::CCLayerTreeHostTestSynchronizeAnimationStartTimes):
(CCLayerTreeHostTestSynchronizeAnimationStartTimes):
(WTF::CCLayerTreeHostTestSynchronizeAnimationStartTimes::willAnimateLayers):
(WTF::CCLayerTreeHostTestSynchronizeAnimationStartTimes::notifyAnimationStarted):

Modified Paths

Diff

Modified: trunk/Source/WebKit/chromium/ChangeLog (113345 => 113346)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-04-05 18:49:13 UTC (rev 113345)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-04-05 18:57:57 UTC (rev 113346)
@@ -1,3 +1,18 @@
+2012-04-05  Ian Vollick  <voll...@chromium.org>
+
+        [chromium] Race condition in CCLayerTreeHostTestSynchronizeAnimationStartTimes
+        https://bugs.webkit.org/show_bug.cgi?id=83179
+
+        Reviewed by James Robinson.
+
+        * tests/CCLayerTreeHostTest.cpp:
+        (WTF::TestHooks::willAnimateLayers):
+        (WTF::MockLayerTreeHostImpl::animateLayers):
+        (WTF::CCLayerTreeHostTestSynchronizeAnimationStartTimes::CCLayerTreeHostTestSynchronizeAnimationStartTimes):
+        (CCLayerTreeHostTestSynchronizeAnimationStartTimes):
+        (WTF::CCLayerTreeHostTestSynchronizeAnimationStartTimes::willAnimateLayers):
+        (WTF::CCLayerTreeHostTestSynchronizeAnimationStartTimes::notifyAnimationStarted):
+
 2012-04-05  Justin Novosad  <ju...@chromium.org>
 
         [Chromium] With the skia port, setting LCD text filtering is causing

Modified: trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp (113345 => 113346)


--- trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp	2012-04-05 18:49:13 UTC (rev 113345)
+++ trunk/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp	2012-04-05 18:57:57 UTC (rev 113346)
@@ -67,6 +67,7 @@
     virtual void prepareToDrawOnCCThread(CCLayerTreeHostImpl*) { }
     virtual void drawLayersOnCCThread(CCLayerTreeHostImpl*) { }
     virtual void animateLayers(CCLayerTreeHostImpl*, double monotonicTime) { }
+    virtual void willAnimateLayers(CCLayerTreeHostImpl*, double monotonicTime) { }
     virtual void applyScrollAndScale(const IntSize&, float) { }
     virtual void updateAnimations(double monotonicTime) { }
     virtual void layout() { }
@@ -113,6 +114,7 @@
 protected:
     virtual void animateLayers(double monotonicTime, double wallClockTime)
     {
+        m_testHooks->willAnimateLayers(this, monotonicTime);
         CCLayerTreeHostImpl::animateLayers(monotonicTime, wallClockTime);
         m_testHooks->animateLayers(this, monotonicTime);
     }
@@ -1081,7 +1083,7 @@
 private:
 };
 
-TEST_F(CCLayerTreeHostTestAddAnimationWithTimingFunction, DISABLED_runMultiThread)
+TEST_F(CCLayerTreeHostTestAddAnimationWithTimingFunction, runMultiThread)
 {
     runTestThreaded();
 }
@@ -1119,8 +1121,7 @@
 class CCLayerTreeHostTestSynchronizeAnimationStartTimes : public CCLayerTreeHostTestThreadOnly {
 public:
     CCLayerTreeHostTestSynchronizeAnimationStartTimes()
-        : m_numAnimates(0)
-        , m_layerTreeHostImpl(0)
+        : m_layerTreeHostImpl(0)
     {
     }
 
@@ -1129,20 +1130,15 @@
         postAddAnimationToMainThread();
     }
 
-    virtual void animateLayers(CCLayerTreeHostImpl* layerTreeHostImpl, double)
+    // This is guaranteed to be called before CCLayerTreeHostImpl::animateLayers.
+    virtual void willAnimateLayers(CCLayerTreeHostImpl* layerTreeHostImpl, double monotonicTime)
     {
         m_layerTreeHostImpl = layerTreeHostImpl;
-
-        if (!m_numAnimates) {
-            m_numAnimates++;
-            return;
-        }
     }
 
     virtual void notifyAnimationStarted(double time)
     {
-        if (!m_numAnimates)
-            return;
+        EXPECT_TRUE(m_layerTreeHostImpl);
 
         CCLayerAnimationController* controllerImpl = m_layerTreeHostImpl->rootLayer()->layerAnimationController();
         CCLayerAnimationController* controller = m_layerTreeHost->rootLayer()->layerAnimationController();
@@ -1159,7 +1155,6 @@
     }
 
 private:
-    int m_numAnimates;
     CCLayerTreeHostImpl* m_layerTreeHostImpl;
 };
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to