summaryrefslogtreecommitdiffstats
path: root/cc/trees/single_thread_proxy.cc
diff options
context:
space:
mode:
authorskyostil <skyostil@chromium.org>2014-09-04 15:07:23 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-04 22:13:39 +0000
commit3976a3f8509145051ff2865ccba0fffe79fe32e6 (patch)
treeca45dac492bdae25c13c97f906eb23fec2455f3b /cc/trees/single_thread_proxy.cc
parentd8988a18cf52f4cfc146a5a57251bfa6cd4ef8f6 (diff)
downloadchromium_src-3976a3f8509145051ff2865ccba0fffe79fe32e6.zip
chromium_src-3976a3f8509145051ff2865ccba0fffe79fe32e6.tar.gz
chromium_src-3976a3f8509145051ff2865ccba0fffe79fe32e6.tar.bz2
cc: Use correct message loop proxy in BlockingTaskRunner
The compositor makes it possible to customize the message loop proxy both on the main and impl threads. However BlockingTaskRunner just uses base::MessageLoopProxy::current() directly and thus overrides this choice. Using the correct message loop proxy is important because clients of BlockingTaskRunner have an implicit dependency on the ordering of tasks posted to BlockingTaskRunner vs. all other tasks posted to the task runner for that same thread. This patch fixes the problem by removing the thread-local BlockingTaskRunner::current() instance in favor of an explicitly constructed instance which is given a specific SingleThreadTaskRunner to use. The resource provider is changed to pass a Proxy-owned blocking task runner to the clients which need one. BUG=391005 TEST=1. Apply https://codereview.chromium.org/363383002 2. out/Debug/chrome --disable-impl-side-painting --ignore-gpu-blacklist tools/perf/page_sets/tough_scheduling_cases/raf_canvas.html Review URL: https://codereview.chromium.org/485043003 Cr-Commit-Position: refs/heads/master@{#293353}
Diffstat (limited to 'cc/trees/single_thread_proxy.cc')
-rw-r--r--cc/trees/single_thread_proxy.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/cc/trees/single_thread_proxy.cc b/cc/trees/single_thread_proxy.cc
index 1ccbdb9d..0e8c81c 100644
--- a/cc/trees/single_thread_proxy.cc
+++ b/cc/trees/single_thread_proxy.cc
@@ -192,7 +192,8 @@ void SingleThreadProxy::DoCommit(const BeginFrameArgs& begin_frame_args) {
// This CapturePostTasks should be destroyed before CommitComplete() is
// called since that goes out to the embedder, and we want the embedder
// to receive its callbacks before that.
- BlockingTaskRunner::CapturePostTasks blocked;
+ BlockingTaskRunner::CapturePostTasks blocked(
+ blocking_main_thread_task_runner());
layer_tree_host_impl_->BeginCommit();
@@ -308,7 +309,8 @@ void SingleThreadProxy::Stop() {
DebugScopedSetMainThreadBlocked main_thread_blocked(this);
DebugScopedSetImplThread impl(this);
- BlockingTaskRunner::CapturePostTasks blocked;
+ BlockingTaskRunner::CapturePostTasks blocked(
+ blocking_main_thread_task_runner());
layer_tree_host_->DeleteContentsTexturesOnImplThread(
layer_tree_host_impl_->resource_provider());
scheduler_on_impl_thread_.reset();
@@ -534,7 +536,8 @@ DrawResult SingleThreadProxy::DoComposite(base::TimeTicks frame_begin_time,
// the swap buffers will execute first.
DebugScopedSetMainThreadBlocked main_thread_blocked(this);
- BlockingTaskRunner::CapturePostTasks blocked;
+ BlockingTaskRunner::CapturePostTasks blocked(
+ blocking_main_thread_task_runner());
layer_tree_host_impl_->SwapBuffers(*frame);
}
DidCommitAndDrawFrame();