diff options
author | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-29 09:49:59 +0000 |
---|---|---|
committer | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-29 09:49:59 +0000 |
commit | 9794fb34f404e81c11df3fc394700b3662b4bfe1 (patch) | |
tree | 13fd16fa2c50b77676a8efa224fce67a3511c76f /cc/cc.gyp | |
parent | 4b2dc3ff3940be1e1f1b3a11627c7285fe2540cc (diff) | |
download | chromium_src-9794fb34f404e81c11df3fc394700b3662b4bfe1.zip chromium_src-9794fb34f404e81c11df3fc394700b3662b4bfe1.tar.gz chromium_src-9794fb34f404e81c11df3fc394700b3662b4bfe1.tar.bz2 |
cc: Use BlockedTaskRunner to immediately run callbacks on the main thread.
This adds a BlockingTaskRunner that wraps a SingleThreadTaskRunner
in a way that allows it to run posted tasks immediately on the
correct thread when possible.
The task runner holds a vector of closures, and each time the
main thread Posts to the impl thread and blocks on a Wait(), it tells
the BlockingTaskRunner to collect PostTasks. While in this state, the
task runner queues up posted tasks directly in its vector. Then
once the main thread resumes, and before passing main thread control
back to the cc/ embedder, the BlockingTaskRunner is informed and runs
all the posted tasks from its vector immediately. This avoids the
PostTask wait and ensures the tasks run before the main thread
control returns to the the cc/ embedder.
This BlockingTaskRunner will also be used to post tasks back
to the main thread to inform about released resources in the
DelegatedRendererLayer. This will ensure that before the embedder
gains control of the main thread after commit, that it also has
available all resources that are known to be released up to that
point.
Tests:
TextureLayerMailboxHolderTest.TwoCompositors_BothReleaseThenMain
TextureLayerMailboxHolderTest.TwoCompositors_MainReleaseBetween
TextureLayerMailboxHolderTest.TwoCompositors_MainReleasedFirst
TextureLayerMailboxHolderTest.TwoCompositors_SecondImplRefShortcut
TextureLayerImplWithMailboxThreadedCallback
R=jamesr, piman, enne
BUG=277959,263069
Review URL: https://chromiumcodereview.appspot.com/23445002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@220249 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/cc.gyp')
-rw-r--r-- | cc/cc.gyp | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -361,6 +361,8 @@ 'scheduler/texture_uploader.cc', 'scheduler/texture_uploader.h', 'scheduler/time_source.h', + 'trees/blocking_task_runner.cc', + 'trees/blocking_task_runner.h', 'trees/damage_tracker.cc', 'trees/damage_tracker.h', 'trees/layer_sorter.cc', |