[Chromium] Schedule texture uploads based on hard-coded timer and vsync.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Aug 2012 19:42:21 +0000 (19:42 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Aug 2012 19:42:21 +0000 (19:42 +0000)
commit7850c199dcfed55f6847fa4b4ae5cbe880424766
treeccd1c8958af5c0104c41f067e514121812c4cd96
parent413c3e1e222297775d38216ae512596d0112402f
[Chromium] Schedule texture uploads based on hard-coded timer and vsync.
https://bugs.webkit.org/show_bug.cgi?id=84281

Patch by David Reveman <reveman@chromium.org> on 2012-08-16
Reviewed by James Robinson.

Source/WebCore:

Improve interaction between vsync and texture uploads by performing
uploads in smaller batches and use a hard-coded timer to emulate
upload completion. This greatly reduces the chance of the compositor
missing a vsync due to being busy with texture uploads.

The CCScheduler client is now given a time limit when told to update
more resources. This time limit is passed to an instance of the
CCTextureUpdateController class, which is responsible for performing
texture updates until the limit is reached.

Unit tests: CCSchedulerTest.RequestCommit
            CCTextureUpdateControllerTest.UpdateMoreTextures
            CCTextureUpdateControllerTest.HasMoreUpdates

* platform/graphics/chromium/cc/CCFrameRateController.cpp:
(WebCore::CCFrameRateController::nextTickTime):
(WebCore):
* platform/graphics/chromium/cc/CCFrameRateController.h:
(CCFrameRateController):
* platform/graphics/chromium/cc/CCScheduler.cpp:
(WebCore::CCScheduler::processScheduledActions):
* platform/graphics/chromium/cc/CCScheduler.h:
(CCSchedulerClient):
* platform/graphics/chromium/cc/CCTextureUpdateController.cpp:
(WebCore::CCTextureUpdateController::maxPartialTextureUpdates):
(WebCore::CCTextureUpdateController::CCTextureUpdateController):
(WebCore::CCTextureUpdateController::updateMoreTextures):
(WebCore):
(WebCore::CCTextureUpdateController::onTimerFired):
(WebCore::CCTextureUpdateController::monotonicTimeNow):
(WebCore::CCTextureUpdateController::updateMoreTexturesTime):
(WebCore::CCTextureUpdateController::updateMoreTexturesSize):
(WebCore::CCTextureUpdateController::updateMoreTexturesIfEnoughTimeRemaining):
(WebCore::CCTextureUpdateController::updateMoreTexturesNow):
* platform/graphics/chromium/cc/CCTextureUpdateController.h:
(WebCore::CCTextureUpdateController::create):
(CCTextureUpdateController):
* platform/graphics/chromium/cc/CCThreadProxy.cpp:
(WebCore::CCThreadProxy::beginFrameCompleteOnImplThread):
(WebCore::CCThreadProxy::scheduledActionUpdateMoreResources):
* platform/graphics/chromium/cc/CCThreadProxy.h:

Source/WebKit/chromium:

* tests/CCSchedulerTest.cpp:
(WebKitTests::TEST):
* tests/CCSchedulerTestCommon.h:
(WebKitTests::FakeCCTimeSource::FakeCCTimeSource):
(WebKitTests::FakeCCTimeSource::setNextTickTime):
(FakeCCTimeSource):
* tests/CCTextureUpdateControllerTest.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@125800 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/cc/CCFrameRateController.cpp
Source/WebCore/platform/graphics/chromium/cc/CCFrameRateController.h
Source/WebCore/platform/graphics/chromium/cc/CCScheduler.cpp
Source/WebCore/platform/graphics/chromium/cc/CCScheduler.h
Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdateController.cpp
Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdateController.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/CCSchedulerTest.cpp
Source/WebKit/chromium/tests/CCSchedulerTestCommon.h
Source/WebKit/chromium/tests/CCTextureUpdateControllerTest.cpp