Title: [110627] trunk/Source
Revision
110627
Author
[email protected]
Date
2012-03-13 15:50:18 -0700 (Tue, 13 Mar 2012)

Log Message

[chromium] vsync ticks are needed in invisible tabs when we are still updating resources
https://bugs.webkit.org/show_bug.cgi?id=80910

Reviewed by James Robinson.

Source/WebCore:

* platform/graphics/chromium/cc/CCSchedulerStateMachine.cpp:
(WebCore::CCSchedulerStateMachine::vsyncCallbackNeeded):

Source/WebKit/chromium:

* tests/CCSchedulerStateMachineTest.cpp:
(WebCore::TEST):
(WebCore):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (110626 => 110627)


--- trunk/Source/WebCore/ChangeLog	2012-03-13 22:40:16 UTC (rev 110626)
+++ trunk/Source/WebCore/ChangeLog	2012-03-13 22:50:18 UTC (rev 110627)
@@ -1,3 +1,13 @@
+2012-03-13  Nat Duca  <[email protected]>
+
+        [chromium] vsync ticks are needed in invisible tabs when we are still updating resources
+        https://bugs.webkit.org/show_bug.cgi?id=80910
+
+        Reviewed by James Robinson.
+
+        * platform/graphics/chromium/cc/CCSchedulerStateMachine.cpp:
+        (WebCore::CCSchedulerStateMachine::vsyncCallbackNeeded):
+
 2012-03-13  Dave Tharp  <[email protected]>
 
         Alternate stylesheets (without title attribute) are loaded on refresh

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCSchedulerStateMachine.cpp (110626 => 110627)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCSchedulerStateMachine.cpp	2012-03-13 22:40:16 UTC (rev 110626)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCSchedulerStateMachine.cpp	2012-03-13 22:50:18 UTC (rev 110627)
@@ -164,13 +164,13 @@
 bool CCSchedulerStateMachine::vsyncCallbackNeeded() const
 {
     if (!m_visible || m_contextState != CONTEXT_ACTIVE) {
-        if (m_needsForcedRedraw)
+        if (m_needsForcedRedraw || m_commitState == COMMIT_STATE_UPDATING_RESOURCES)
             return true;
 
         return false;
     }
 
-    return m_needsRedraw || m_needsForcedRedraw || m_updateMoreResourcesPending;
+    return m_needsRedraw || m_needsForcedRedraw || m_commitState == COMMIT_STATE_UPDATING_RESOURCES;
 }
 
 void CCSchedulerStateMachine::didEnterVSync()

Modified: trunk/Source/WebKit/chromium/ChangeLog (110626 => 110627)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-03-13 22:40:16 UTC (rev 110626)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-03-13 22:50:18 UTC (rev 110627)
@@ -1,3 +1,14 @@
+2012-03-13  Nat Duca  <[email protected]>
+
+        [chromium] vsync ticks are needed in invisible tabs when we are still updating resources
+        https://bugs.webkit.org/show_bug.cgi?id=80910
+
+        Reviewed by James Robinson.
+
+        * tests/CCSchedulerStateMachineTest.cpp:
+        (WebCore::TEST):
+        (WebCore):
+
 2012-03-13  Dana Jansens  <[email protected]>
 
         Region::contains(IntPoint) is slow

Modified: trunk/Source/WebKit/chromium/tests/CCSchedulerStateMachineTest.cpp (110626 => 110627)


--- trunk/Source/WebKit/chromium/tests/CCSchedulerStateMachineTest.cpp	2012-03-13 22:40:16 UTC (rev 110626)
+++ trunk/Source/WebKit/chromium/tests/CCSchedulerStateMachineTest.cpp	2012-03-13 22:50:18 UTC (rev 110627)
@@ -159,31 +159,13 @@
             } else
                 state.setVisible(true);
 
-            // Case 1: needsCommit=false updateMoreResourcesPending=false.
+            // Case 1: needsCommit=false
             state.setNeedsCommit(false);
-            state.setUpdateMoreResourcesPending(false);
-            EXPECT_FALSE(state.vsyncCallbackNeeded());
             EXPECT_NE(CCSchedulerStateMachine::ACTION_DRAW, state.nextAction());
 
-            // Case 2: needsCommit=false updateMoreResourcesPending=true.
-            state.setNeedsCommit(false);
-            state.setUpdateMoreResourcesPending(true);
-            if (visible)
-                EXPECT_TRUE(state.vsyncCallbackNeeded());
-            EXPECT_NE(CCSchedulerStateMachine::ACTION_DRAW, state.nextAction());
-
-            // Case 3: needsCommit=true updateMoreResourcesPending=false.
+            // Case 2: needsCommit=true
             state.setNeedsCommit(true);
-            state.setUpdateMoreResourcesPending(false);
-            EXPECT_FALSE(state.vsyncCallbackNeeded());
             EXPECT_NE(CCSchedulerStateMachine::ACTION_DRAW, state.nextAction());
-
-            // Case 4: needsCommit=true updateMoreResourcesPending=true.
-            state.setNeedsCommit(true);
-            state.setUpdateMoreResourcesPending(true);
-            if (visible)
-                EXPECT_TRUE(state.vsyncCallbackNeeded());
-            EXPECT_NE(CCSchedulerStateMachine::ACTION_DRAW, state.nextAction());
         }
     }
 
@@ -371,6 +353,20 @@
     EXPECT_EQ(CCSchedulerStateMachine::ACTION_COMMIT, state.nextAction());
 }
 
+
+TEST(CCSchedulerStateMachineTest, TestVSyncNeededWhenUpdatesPendingButInvisible)
+{
+    StateMachine state;
+    state.setCommitState(CCSchedulerStateMachine::COMMIT_STATE_UPDATING_RESOURCES);
+    state.setNeedsRedraw(false);
+    state.setVisible(false);
+    state.setUpdateMoreResourcesPending(true);
+    EXPECT_TRUE(state.vsyncCallbackNeeded());
+
+    state.setUpdateMoreResourcesPending(false);
+    EXPECT_TRUE(state.vsyncCallbackNeeded());
+}
+
 TEST(CCSchedulerStateMachineTest, TestUpdates_WithRedraw_OneRoundOfUpdates)
 {
     StateMachine state;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to