Title: [125939] trunk/Source
- Revision
- 125939
- Author
- [email protected]
- Date
- 2012-08-17 14:50:22 -0700 (Fri, 17 Aug 2012)
Log Message
Fix vsyncTick drought when vsync throttling is disabled
https://bugs.webkit.org/show_bug.cgi?id=94012
Patch by Brian Anderson <[email protected]> on 2012-08-17
Reviewed by James Robinson.
CCFrameRateController made an assumption that every vsyncTick results
in a call to didBeginFrame, which is not necessarily true and causes
the CCFrameRateController to stop ticking when vsync is disabled. We
move the manual ticks out of didBeginFrame and manually tick in the
proper place.
CCFrameRateControllerTest updated with use cases that should tick
without a didBeginFrame and will fail without this patch.
* platform/graphics/chromium/cc/CCFrameRateController.cpp:
(WebCore::CCFrameRateController::setActive):
(WebCore::CCFrameRateController::onTimerTick):
(WebCore::CCFrameRateController::didBeginFrame):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (125938 => 125939)
--- trunk/Source/WebCore/ChangeLog 2012-08-17 21:46:26 UTC (rev 125938)
+++ trunk/Source/WebCore/ChangeLog 2012-08-17 21:50:22 UTC (rev 125939)
@@ -1,3 +1,24 @@
+2012-08-17 Brian Anderson <[email protected]>
+
+ Fix vsyncTick drought when vsync throttling is disabled
+ https://bugs.webkit.org/show_bug.cgi?id=94012
+
+ Reviewed by James Robinson.
+
+ CCFrameRateController made an assumption that every vsyncTick results
+ in a call to didBeginFrame, which is not necessarily true and causes
+ the CCFrameRateController to stop ticking when vsync is disabled. We
+ move the manual ticks out of didBeginFrame and manually tick in the
+ proper place.
+
+ CCFrameRateControllerTest updated with use cases that should tick
+ without a didBeginFrame and will fail without this patch.
+
+ * platform/graphics/chromium/cc/CCFrameRateController.cpp:
+ (WebCore::CCFrameRateController::setActive):
+ (WebCore::CCFrameRateController::onTimerTick):
+ (WebCore::CCFrameRateController::didBeginFrame):
+
2012-08-16 Ojan Vafai <[email protected]>
Delete some dead code in RenderBox::computePercentageLogicalHeight
Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCFrameRateController.cpp (125938 => 125939)
--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCFrameRateController.cpp 2012-08-17 21:46:26 UTC (rev 125938)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCFrameRateController.cpp 2012-08-17 21:50:22 UTC (rev 125939)
@@ -117,6 +117,10 @@
if (m_client)
m_client->vsyncTick();
+
+ if (!m_isTimeSourceThrottling
+ && (!m_maxFramesPending || m_numFramesPending < m_maxFramesPending))
+ postManualTick();
}
void CCFrameRateController::postManualTick()
@@ -133,8 +137,6 @@
void CCFrameRateController::didBeginFrame()
{
m_numFramesPending++;
- if (!m_isTimeSourceThrottling)
- postManualTick();
}
void CCFrameRateController::didFinishFrame()
Modified: trunk/Source/WebKit/chromium/tests/CCFrameRateControllerTest.cpp (125938 => 125939)
--- trunk/Source/WebKit/chromium/tests/CCFrameRateControllerTest.cpp 2012-08-17 21:46:26 UTC (rev 125938)
+++ trunk/Source/WebKit/chromium/tests/CCFrameRateControllerTest.cpp 2012-08-17 21:50:22 UTC (rev 125939)
@@ -154,6 +154,17 @@
EXPECT_TRUE(client.vsyncTicked());
client.reset();
+ // Even if we don't call didBeginFrame, CCFrameRateController should
+ // still attempt to vsync tick multiple times until it does result in
+ // a didBeginFrame.
+ thread.runPendingTask();
+ EXPECT_TRUE(client.vsyncTicked());
+ client.reset();
+
+ thread.runPendingTask();
+ EXPECT_TRUE(client.vsyncTicked());
+ client.reset();
+
// didBeginFrame triggers 2nd frame, make sure the vsync callback is called
controller.didBeginFrame();
thread.runPendingTask();
@@ -166,6 +177,9 @@
EXPECT_FALSE(client.vsyncTicked());
client.reset();
+ // Make sure there is no pending task since we can't do anything until we receive a didFinishFrame anyway.
+ EXPECT_FALSE(thread.hasPendingTask());
+
// didFinishFrame triggers a frame, make sure the vsync callback is called
controller.didFinishFrame();
thread.runPendingTask();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes