[chromium] Skip frames when checkerboarding an animation
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Mar 2012 01:51:35 +0000 (01:51 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Mar 2012 01:51:35 +0000 (01:51 +0000)
commit3d3227e88eeef39b05620620c142bef3c442a671
tree7942a5b1a4d5a01b9e359873d2d96037587b124f
parent61838b4b641fd84492d6f585b8b41bfa94658c3e
[chromium] Skip frames when checkerboarding an animation
https://bugs.webkit.org/show_bug.cgi?id=81716

Patch by Dana Jansens <danakj@chromium.org> on 2012-03-22
Reviewed by Adrienne Walker.

Source/WebCore:

This will stop drawing frames when prepareToDraw fails, if the draw is
not forced. The expected behaviour is outlined below by the unit tests.

When a draw fails, we:
1. Set m_needsRedraw to try again next vsync
2. Set m_needsCommit because we need more data from webkit to succeed
3. Set m_drawIfPossibleFailed. This allows us to try draw again within
the same vsync *if* a commit finishes during this time.

Unit test: CCSchedulerTest.RequestRedrawInsideFailedDraw
           CCSchedulerTest.RequestCommitInsideFailedDraw
           CCSchedulerTest.NoBeginFrameWhenDrawFails
           CCSchedulerStateMachineTest.TestFailedDrawSetsNeedsCommitAndDoesNotDrawAgain
           CCSchedulerStateMachineTest.TestSetNeedsRedrawDuringFailedDrawDoesNotRemoveNeedsRedraw
           CCSchedulerStateMachineTest.TestCommitAfterFailedDrawAllowsDrawInSameFrame
           CCSchedulerStateMachineTest.TestCommitAfterFailedAndSuccessfulDrawDoesNotAllowDrawInSameFrame
           CCSchedulerStateMachineTest.TestFailedDrawIsRetriedNextVSync

* platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
(WebCore::CCLayerTreeHostImpl::calculateRenderPasses):
(WebCore::CCLayerTreeHostImpl::prepareToDraw):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:
(CCLayerTreeHostImpl):
* platform/graphics/chromium/cc/CCScheduler.cpp:
(WebCore::CCScheduler::processScheduledActions):
* platform/graphics/chromium/cc/CCScheduler.h:
(CCSchedulerClient):
* platform/graphics/chromium/cc/CCSchedulerStateMachine.cpp:
(WebCore::CCSchedulerStateMachine::CCSchedulerStateMachine):
(WebCore::CCSchedulerStateMachine::nextAction):
(WebCore::CCSchedulerStateMachine::updateState):
(WebCore::CCSchedulerStateMachine::didDrawIfPossibleCompleted):
(WebCore):
* platform/graphics/chromium/cc/CCSchedulerStateMachine.h:
(CCSchedulerStateMachine):
* platform/graphics/chromium/cc/CCThreadProxy.cpp:
(WebCore::CCThreadProxy::scheduledActionDrawAndSwapInternal):
(WebCore):
(WebCore::CCThreadProxy::scheduledActionDrawAndSwapIfPossible):
(WebCore::CCThreadProxy::scheduledActionDrawAndSwapForced):
* platform/graphics/chromium/cc/CCThreadProxy.h:
(CCThreadProxy):

Source/WebKit/chromium:

* tests/CCLayerTreeHostImplTest.cpp:
(WebKitTests::TEST_F):
* tests/CCSchedulerStateMachineTest.cpp:
(WebCore::TEST):
(WebCore):
* tests/CCSchedulerTest.cpp:
(WebKitTests::FakeCCSchedulerClient::reset):
(WebKitTests::FakeCCSchedulerClient::numDraws):
(WebKitTests::FakeCCSchedulerClient::scheduledActionDrawAndSwapIfPossible):
(FakeCCSchedulerClient):
(WebKitTests::FakeCCSchedulerClient::scheduledActionDrawAndSwapForced):
(WebKitTests::FakeCCSchedulerClient::setDrawSuccess):
(WebKitTests::TEST):
(WebKitTests::SchedulerClientThatSetNeedsDrawInsideDraw::SchedulerClientThatSetNeedsDrawInsideDraw):
(WebKitTests::SchedulerClientThatSetNeedsDrawInsideDraw::scheduledActionDrawAndSwapIfPossible):
(WebKitTests::SchedulerClientThatSetNeedsDrawInsideDraw::scheduledActionDrawAndSwapForced):
(SchedulerClientThatSetNeedsDrawInsideDraw):
(WebKitTests):
(WebKitTests::SchedulerClientThatSetNeedsCommitInsideDraw::SchedulerClientThatSetNeedsCommitInsideDraw):
(WebKitTests::SchedulerClientThatSetNeedsCommitInsideDraw::scheduledActionDrawAndSwapIfPossible):
(WebKitTests::SchedulerClientThatSetNeedsCommitInsideDraw::scheduledActionDrawAndSwapForced):
(SchedulerClientThatSetNeedsCommitInsideDraw):
* tests/CCSchedulerTestCommon.h:
(FakeCCFrameRateController):
(WebKitTests::FakeCCFrameRateController::FakeCCFrameRateController):
(WebKitTests::FakeCCFrameRateController::numFramesPending):
(WebKitTests):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@111805 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h
Source/WebCore/platform/graphics/chromium/cc/CCScheduler.cpp
Source/WebCore/platform/graphics/chromium/cc/CCScheduler.h
Source/WebCore/platform/graphics/chromium/cc/CCSchedulerStateMachine.cpp
Source/WebCore/platform/graphics/chromium/cc/CCSchedulerStateMachine.h
Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp
Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp
Source/WebKit/chromium/tests/CCSchedulerStateMachineTest.cpp
Source/WebKit/chromium/tests/CCSchedulerTest.cpp
Source/WebKit/chromium/tests/CCSchedulerTestCommon.h