| 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/layer_tree_host_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 #include "cc/resources/ui_resource_bitmap.h" | 49 #include "cc/resources/ui_resource_bitmap.h" |
| 50 #include "cc/scheduler/delay_based_time_source.h" | 50 #include "cc/scheduler/delay_based_time_source.h" |
| 51 #include "cc/scheduler/texture_uploader.h" | 51 #include "cc/scheduler/texture_uploader.h" |
| 52 #include "cc/trees/damage_tracker.h" | 52 #include "cc/trees/damage_tracker.h" |
| 53 #include "cc/trees/layer_tree_host.h" | 53 #include "cc/trees/layer_tree_host.h" |
| 54 #include "cc/trees/layer_tree_host_common.h" | 54 #include "cc/trees/layer_tree_host_common.h" |
| 55 #include "cc/trees/layer_tree_impl.h" | 55 #include "cc/trees/layer_tree_impl.h" |
| 56 #include "cc/trees/quad_culler.h" | 56 #include "cc/trees/quad_culler.h" |
| 57 #include "cc/trees/single_thread_proxy.h" | 57 #include "cc/trees/single_thread_proxy.h" |
| 58 #include "cc/trees/tree_synchronizer.h" | 58 #include "cc/trees/tree_synchronizer.h" |
| 59 #include "ui/gfx/frame_time.h" |
| 59 #include "ui/gfx/size_conversions.h" | 60 #include "ui/gfx/size_conversions.h" |
| 60 #include "ui/gfx/vector2d_conversions.h" | 61 #include "ui/gfx/vector2d_conversions.h" |
| 61 | 62 |
| 62 namespace { | 63 namespace { |
| 63 | 64 |
| 64 void DidVisibilityChange(cc::LayerTreeHostImpl* id, bool visible) { | 65 void DidVisibilityChange(cc::LayerTreeHostImpl* id, bool visible) { |
| 65 if (visible) { | 66 if (visible) { |
| 66 TRACE_EVENT_ASYNC_BEGIN1("webkit", | 67 TRACE_EVENT_ASYNC_BEGIN1("webkit", |
| 67 "LayerTreeHostImpl::SetVisible", | 68 "LayerTreeHostImpl::SetVisible", |
| 68 id, | 69 id, |
| (...skipping 2605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2674 UpdateCurrentFrameTime(¤t_frame_timeticks_, ¤t_frame_time_); | 2675 UpdateCurrentFrameTime(¤t_frame_timeticks_, ¤t_frame_time_); |
| 2675 return current_frame_timeticks_; | 2676 return current_frame_timeticks_; |
| 2676 } | 2677 } |
| 2677 | 2678 |
| 2678 base::Time LayerTreeHostImpl::CurrentFrameTime() { | 2679 base::Time LayerTreeHostImpl::CurrentFrameTime() { |
| 2679 UpdateCurrentFrameTime(¤t_frame_timeticks_, ¤t_frame_time_); | 2680 UpdateCurrentFrameTime(¤t_frame_timeticks_, ¤t_frame_time_); |
| 2680 return current_frame_time_; | 2681 return current_frame_time_; |
| 2681 } | 2682 } |
| 2682 | 2683 |
| 2683 base::TimeTicks LayerTreeHostImpl::CurrentPhysicalTimeTicks() const { | 2684 base::TimeTicks LayerTreeHostImpl::CurrentPhysicalTimeTicks() const { |
| 2684 return base::TimeTicks::Now(); | 2685 return gfx::FrameTime::Now(); |
| 2685 } | 2686 } |
| 2686 | 2687 |
| 2687 scoped_ptr<base::Value> LayerTreeHostImpl::AsValueWithFrame( | 2688 scoped_ptr<base::Value> LayerTreeHostImpl::AsValueWithFrame( |
| 2688 FrameData* frame) const { | 2689 FrameData* frame) const { |
| 2689 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); | 2690 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
| 2690 if (this->pending_tree_) | 2691 if (this->pending_tree_) |
| 2691 state->Set("activation_state", ActivationStateAsValue().release()); | 2692 state->Set("activation_state", ActivationStateAsValue().release()); |
| 2692 state->Set("device_viewport_size", | 2693 state->Set("device_viewport_size", |
| 2693 MathUtil::AsValue(device_viewport_size_).release()); | 2694 MathUtil::AsValue(device_viewport_size_).release()); |
| 2694 if (tile_manager_) | 2695 if (tile_manager_) |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2804 std::set<UIResourceId>::iterator found_in_evicted = | 2805 std::set<UIResourceId>::iterator found_in_evicted = |
| 2805 evicted_ui_resources_.find(uid); | 2806 evicted_ui_resources_.find(uid); |
| 2806 if (found_in_evicted == evicted_ui_resources_.end()) | 2807 if (found_in_evicted == evicted_ui_resources_.end()) |
| 2807 return; | 2808 return; |
| 2808 evicted_ui_resources_.erase(found_in_evicted); | 2809 evicted_ui_resources_.erase(found_in_evicted); |
| 2809 if (evicted_ui_resources_.empty()) | 2810 if (evicted_ui_resources_.empty()) |
| 2810 client_->OnCanDrawStateChanged(CanDraw()); | 2811 client_->OnCanDrawStateChanged(CanDraw()); |
| 2811 } | 2812 } |
| 2812 | 2813 |
| 2813 } // namespace cc | 2814 } // namespace cc |
| OLD | NEW |