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

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

Issue 17362002: cc: Remove FakeThread, use SingleThreadTaskRunner in scheduling classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rm-fakethread: Created 7 years, 6 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
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/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
11 #include "base/metrics/histogram.h" 11 #include "base/metrics/histogram.h"
12 #include "base/stl_util.h" 12 #include "base/stl_util.h"
13 #include "base/strings/stringprintf.h" 13 #include "base/strings/stringprintf.h"
14 #include "cc/animation/scrollbar_animation_controller.h" 14 #include "cc/animation/scrollbar_animation_controller.h"
15 #include "cc/animation/timing_function.h" 15 #include "cc/animation/timing_function.h"
16 #include "cc/base/math_util.h" 16 #include "cc/base/math_util.h"
17 #include "cc/base/thread.h"
17 #include "cc/base/util.h" 18 #include "cc/base/util.h"
18 #include "cc/debug/debug_rect_history.h" 19 #include "cc/debug/debug_rect_history.h"
19 #include "cc/debug/frame_rate_counter.h" 20 #include "cc/debug/frame_rate_counter.h"
20 #include "cc/debug/overdraw_metrics.h" 21 #include "cc/debug/overdraw_metrics.h"
21 #include "cc/debug/paint_time_counter.h" 22 #include "cc/debug/paint_time_counter.h"
22 #include "cc/debug/rendering_stats_instrumentation.h" 23 #include "cc/debug/rendering_stats_instrumentation.h"
23 #include "cc/debug/traced_value.h" 24 #include "cc/debug/traced_value.h"
24 #include "cc/input/page_scale_animation.h" 25 #include "cc/input/page_scale_animation.h"
25 #include "cc/input/top_controls_manager.h" 26 #include "cc/input/top_controls_manager.h"
26 #include "cc/layers/append_quads_data.h" 27 #include "cc/layers/append_quads_data.h"
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 bool should_background_tick) { 769 bool should_background_tick) {
769 bool enabled = should_background_tick && 770 bool enabled = should_background_tick &&
770 !animation_registrar_->active_animation_controllers().empty(); 771 !animation_registrar_->active_animation_controllers().empty();
771 772
772 // Lazily create the time_source adapter so that we can vary the interval for 773 // Lazily create the time_source adapter so that we can vary the interval for
773 // testing. 774 // testing.
774 if (!time_source_client_adapter_) { 775 if (!time_source_client_adapter_) {
775 time_source_client_adapter_ = LayerTreeHostImplTimeSourceAdapter::Create( 776 time_source_client_adapter_ = LayerTreeHostImplTimeSourceAdapter::Create(
776 this, 777 this,
777 DelayBasedTimeSource::Create(LowFrequencyAnimationInterval(), 778 DelayBasedTimeSource::Create(LowFrequencyAnimationInterval(),
778 proxy_->CurrentThread())); 779 proxy_->CurrentThread()->TaskRunner()));
779 } 780 }
780 781
781 time_source_client_adapter_->SetActive(enabled); 782 time_source_client_adapter_->SetActive(enabled);
782 } 783 }
783 784
784 void LayerTreeHostImpl::SetViewportDamage(gfx::Rect damage_rect) { 785 void LayerTreeHostImpl::SetViewportDamage(gfx::Rect damage_rect) {
785 viewport_damage_rect_.Union(damage_rect); 786 viewport_damage_rect_.Union(damage_rect);
786 } 787 }
787 788
788 static inline RenderPass* FindRenderPassById( 789 static inline RenderPass* FindRenderPassById(
(...skipping 1533 matching lines...) Expand 10 before | Expand all | Expand 10 after
2322 } 2323 }
2323 2324
2324 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) { 2325 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) {
2325 if (debug_state_.continuous_painting != debug_state.continuous_painting) 2326 if (debug_state_.continuous_painting != debug_state.continuous_painting)
2326 paint_time_counter_->ClearHistory(); 2327 paint_time_counter_->ClearHistory();
2327 2328
2328 debug_state_ = debug_state; 2329 debug_state_ = debug_state;
2329 } 2330 }
2330 2331
2331 } // namespace cc 2332 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698