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

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

Issue 608503005: Revert of cc: Remove use of PassAs() and constructor-casting with scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « cc/trees/occlusion_tracker_unittest.cc ('k') | cc/trees/thread_proxy.cc » ('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 "cc/trees/scoped_abort_remaining_swap_promises.h" 19 #include "cc/trees/scoped_abort_remaining_swap_promises.h"
20 #include "ui/gfx/frame_time.h" 20 #include "ui/gfx/frame_time.h"
21 21
22 namespace cc { 22 namespace cc {
23 23
24 scoped_ptr<Proxy> SingleThreadProxy::Create( 24 scoped_ptr<Proxy> SingleThreadProxy::Create(
25 LayerTreeHost* layer_tree_host, 25 LayerTreeHost* layer_tree_host,
26 LayerTreeHostSingleThreadClient* client, 26 LayerTreeHostSingleThreadClient* client,
27 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner) { 27 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner) {
28 return make_scoped_ptr( 28 return make_scoped_ptr(
29 new SingleThreadProxy(layer_tree_host, client, main_task_runner)); 29 new SingleThreadProxy(layer_tree_host, client, main_task_runner))
30 .PassAs<Proxy>();
30 } 31 }
31 32
32 SingleThreadProxy::SingleThreadProxy( 33 SingleThreadProxy::SingleThreadProxy(
33 LayerTreeHost* layer_tree_host, 34 LayerTreeHost* layer_tree_host,
34 LayerTreeHostSingleThreadClient* client, 35 LayerTreeHostSingleThreadClient* client,
35 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner) 36 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner)
36 : Proxy(main_task_runner, NULL), 37 : Proxy(main_task_runner, NULL),
37 layer_tree_host_(layer_tree_host), 38 layer_tree_host_(layer_tree_host),
38 client_(client), 39 client_(client),
39 timing_history_(layer_tree_host->rendering_stats_instrumentation()), 40 timing_history_(layer_tree_host->rendering_stats_instrumentation()),
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 TRACE_EVENT0("cc", "SingleThreadProxy::stop"); 307 TRACE_EVENT0("cc", "SingleThreadProxy::stop");
307 DCHECK(Proxy::IsMainThread()); 308 DCHECK(Proxy::IsMainThread());
308 { 309 {
309 DebugScopedSetMainThreadBlocked main_thread_blocked(this); 310 DebugScopedSetMainThreadBlocked main_thread_blocked(this);
310 DebugScopedSetImplThread impl(this); 311 DebugScopedSetImplThread impl(this);
311 312
312 BlockingTaskRunner::CapturePostTasks blocked( 313 BlockingTaskRunner::CapturePostTasks blocked(
313 blocking_main_thread_task_runner()); 314 blocking_main_thread_task_runner());
314 layer_tree_host_->DeleteContentsTexturesOnImplThread( 315 layer_tree_host_->DeleteContentsTexturesOnImplThread(
315 layer_tree_host_impl_->resource_provider()); 316 layer_tree_host_impl_->resource_provider());
316 scheduler_on_impl_thread_ = nullptr; 317 scheduler_on_impl_thread_.reset();
317 layer_tree_host_impl_ = nullptr; 318 layer_tree_host_impl_.reset();
318 } 319 }
319 layer_tree_host_ = NULL; 320 layer_tree_host_ = NULL;
320 } 321 }
321 322
322 void SingleThreadProxy::OnCanDrawStateChanged(bool can_draw) { 323 void SingleThreadProxy::OnCanDrawStateChanged(bool can_draw) {
323 TRACE_EVENT1( 324 TRACE_EVENT1(
324 "cc", "SingleThreadProxy::OnCanDrawStateChanged", "can_draw", can_draw); 325 "cc", "SingleThreadProxy::OnCanDrawStateChanged", "can_draw", can_draw);
325 DCHECK(Proxy::IsImplThread()); 326 DCHECK(Proxy::IsImplThread());
326 UpdateBackgroundAnimateTicking(); 327 UpdateBackgroundAnimateTicking();
327 if (scheduler_on_impl_thread_) 328 if (scheduler_on_impl_thread_)
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 690
690 base::TimeDelta SingleThreadProxy::CommitToActivateDurationEstimate() { 691 base::TimeDelta SingleThreadProxy::CommitToActivateDurationEstimate() {
691 return timing_history_.CommitToActivateDurationEstimate(); 692 return timing_history_.CommitToActivateDurationEstimate();
692 } 693 }
693 694
694 void SingleThreadProxy::DidBeginImplFrameDeadline() { 695 void SingleThreadProxy::DidBeginImplFrameDeadline() {
695 layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame(); 696 layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame();
696 } 697 }
697 698
698 } // namespace cc 699 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/occlusion_tracker_unittest.cc ('k') | cc/trees/thread_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698