OLD | NEW |
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/thread_proxy.h" | 5 #include "cc/trees/thread_proxy.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "cc/base/thread.h" | 10 #include "cc/base/thread.h" |
(...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1049 else if (result == LayerTreeHost::RecreateSucceeded) | 1049 else if (result == LayerTreeHost::RecreateSucceeded) |
1050 output_surface_recreation_callback_.Cancel(); | 1050 output_surface_recreation_callback_.Cancel(); |
1051 } | 1051 } |
1052 | 1052 |
1053 void ThreadProxy::InitializeImplOnImplThread(CompletionEvent* completion, | 1053 void ThreadProxy::InitializeImplOnImplThread(CompletionEvent* completion, |
1054 InputHandler* handler) { | 1054 InputHandler* handler) { |
1055 TRACE_EVENT0("cc", "ThreadProxy::InitializeImplOnImplThread"); | 1055 TRACE_EVENT0("cc", "ThreadProxy::InitializeImplOnImplThread"); |
1056 DCHECK(IsImplThread()); | 1056 DCHECK(IsImplThread()); |
1057 layer_tree_host_impl_ = layer_tree_host_->CreateLayerTreeHostImpl(this); | 1057 layer_tree_host_impl_ = layer_tree_host_->CreateLayerTreeHostImpl(this); |
1058 const base::TimeDelta display_refresh_interval = | 1058 const base::TimeDelta display_refresh_interval = |
1059 base::TimeDelta::FromMicroseconds(base::Time::kMicrosecondsPerSecond / | 1059 base::TimeDelta::FromMicroseconds( |
1060 60); | 1060 base::Time::kMicrosecondsPerSecond / |
| 1061 layer_tree_host_->settings().refresh_rate); |
1061 scoped_ptr<FrameRateController> frame_rate_controller; | 1062 scoped_ptr<FrameRateController> frame_rate_controller; |
1062 if (render_vsync_enabled_) { | 1063 if (render_vsync_enabled_) { |
1063 if (render_vsync_notification_enabled_) { | 1064 if (render_vsync_notification_enabled_) { |
1064 frame_rate_controller.reset( | 1065 frame_rate_controller.reset( |
1065 new FrameRateController(VSyncTimeSource::Create(this))); | 1066 new FrameRateController(VSyncTimeSource::Create(this))); |
1066 } else { | 1067 } else { |
1067 frame_rate_controller.reset( | 1068 frame_rate_controller.reset( |
1068 new FrameRateController(DelayBasedTimeSource::Create( | 1069 new FrameRateController(DelayBasedTimeSource::Create( |
1069 display_refresh_interval, Proxy::ImplThread()))); | 1070 display_refresh_interval, Proxy::ImplThread()))); |
1070 } | 1071 } |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1313 base::Bind(&ThreadProxy::StartScrollbarAnimationOnImplThread, | 1314 base::Bind(&ThreadProxy::StartScrollbarAnimationOnImplThread, |
1314 impl_thread_weak_ptr_), | 1315 impl_thread_weak_ptr_), |
1315 delay); | 1316 delay); |
1316 } | 1317 } |
1317 | 1318 |
1318 void ThreadProxy::StartScrollbarAnimationOnImplThread() { | 1319 void ThreadProxy::StartScrollbarAnimationOnImplThread() { |
1319 layer_tree_host_impl_->StartScrollbarAnimation(base::TimeTicks::Now()); | 1320 layer_tree_host_impl_->StartScrollbarAnimation(base::TimeTicks::Now()); |
1320 } | 1321 } |
1321 | 1322 |
1322 } // namespace cc | 1323 } // namespace cc |
OLD | NEW |