Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(178)

Side by Side Diff: cc/trees/single_thread_proxy.cc

Issue 400773002: cc: Parameterize the main thread task runner (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: WebView fix. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/trees/single_thread_proxy.h ('k') | cc/trees/thread_proxy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/single_thread_proxy.h" 5 #include "cc/trees/single_thread_proxy.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "cc/debug/benchmark_instrumentation.h" 9 #include "cc/debug/benchmark_instrumentation.h"
10 #include "cc/output/context_provider.h" 10 #include "cc/output/context_provider.h"
11 #include "cc/output/output_surface.h" 11 #include "cc/output/output_surface.h"
12 #include "cc/quads/draw_quad.h" 12 #include "cc/quads/draw_quad.h"
13 #include "cc/resources/prioritized_resource_manager.h" 13 #include "cc/resources/prioritized_resource_manager.h"
14 #include "cc/resources/resource_update_controller.h" 14 #include "cc/resources/resource_update_controller.h"
15 #include "cc/trees/blocking_task_runner.h" 15 #include "cc/trees/blocking_task_runner.h"
16 #include "cc/trees/layer_tree_host.h" 16 #include "cc/trees/layer_tree_host.h"
17 #include "cc/trees/layer_tree_host_single_thread_client.h" 17 #include "cc/trees/layer_tree_host_single_thread_client.h"
18 #include "cc/trees/layer_tree_impl.h" 18 #include "cc/trees/layer_tree_impl.h"
19 #include "ui/gfx/frame_time.h" 19 #include "ui/gfx/frame_time.h"
20 20
21 namespace cc { 21 namespace cc {
22 22
23 scoped_ptr<Proxy> SingleThreadProxy::Create( 23 scoped_ptr<Proxy> SingleThreadProxy::Create(
24 LayerTreeHost* layer_tree_host, 24 LayerTreeHost* layer_tree_host,
25 LayerTreeHostSingleThreadClient* client) { 25 LayerTreeHostSingleThreadClient* client,
26 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner) {
26 return make_scoped_ptr( 27 return make_scoped_ptr(
27 new SingleThreadProxy(layer_tree_host, client)).PassAs<Proxy>(); 28 new SingleThreadProxy(layer_tree_host, client, main_task_runner))
29 .PassAs<Proxy>();
28 } 30 }
29 31
30 SingleThreadProxy::SingleThreadProxy(LayerTreeHost* layer_tree_host, 32 SingleThreadProxy::SingleThreadProxy(
31 LayerTreeHostSingleThreadClient* client) 33 LayerTreeHost* layer_tree_host,
32 : Proxy(NULL), 34 LayerTreeHostSingleThreadClient* client,
35 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner)
36 : Proxy(main_task_runner, NULL),
33 layer_tree_host_(layer_tree_host), 37 layer_tree_host_(layer_tree_host),
34 client_(client), 38 client_(client),
35 next_frame_is_newly_committed_frame_(false), 39 next_frame_is_newly_committed_frame_(false),
36 inside_draw_(false) { 40 inside_draw_(false) {
37 TRACE_EVENT0("cc", "SingleThreadProxy::SingleThreadProxy"); 41 TRACE_EVENT0("cc", "SingleThreadProxy::SingleThreadProxy");
38 DCHECK(Proxy::IsMainThread()); 42 DCHECK(Proxy::IsMainThread());
39 DCHECK(layer_tree_host); 43 DCHECK(layer_tree_host);
40 44
41 // Impl-side painting not supported without threaded compositing. 45 // Impl-side painting not supported without threaded compositing.
42 CHECK(!layer_tree_host->settings().impl_side_painting) 46 CHECK(!layer_tree_host->settings().impl_side_painting)
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 void SingleThreadProxy::DidSwapFrame() { 456 void SingleThreadProxy::DidSwapFrame() {
453 if (next_frame_is_newly_committed_frame_) { 457 if (next_frame_is_newly_committed_frame_) {
454 next_frame_is_newly_committed_frame_ = false; 458 next_frame_is_newly_committed_frame_ = false;
455 layer_tree_host_->DidCommitAndDrawFrame(); 459 layer_tree_host_->DidCommitAndDrawFrame();
456 } 460 }
457 } 461 }
458 462
459 bool SingleThreadProxy::CommitPendingForTesting() { return false; } 463 bool SingleThreadProxy::CommitPendingForTesting() { return false; }
460 464
461 } // namespace cc 465 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/single_thread_proxy.h ('k') | cc/trees/thread_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698