| 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 2617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2686 UpdateCurrentFrameTime(¤t_frame_timeticks_, ¤t_frame_time_); | 2687 UpdateCurrentFrameTime(¤t_frame_timeticks_, ¤t_frame_time_); |
| 2687 return current_frame_timeticks_; | 2688 return current_frame_timeticks_; |
| 2688 } | 2689 } |
| 2689 | 2690 |
| 2690 base::Time LayerTreeHostImpl::CurrentFrameTime() { | 2691 base::Time LayerTreeHostImpl::CurrentFrameTime() { |
| 2691 UpdateCurrentFrameTime(¤t_frame_timeticks_, ¤t_frame_time_); | 2692 UpdateCurrentFrameTime(¤t_frame_timeticks_, ¤t_frame_time_); |
| 2692 return current_frame_time_; | 2693 return current_frame_time_; |
| 2693 } | 2694 } |
| 2694 | 2695 |
| 2695 base::TimeTicks LayerTreeHostImpl::CurrentPhysicalTimeTicks() const { | 2696 base::TimeTicks LayerTreeHostImpl::CurrentPhysicalTimeTicks() const { |
| 2696 return base::TimeTicks::Now(); | 2697 return gfx::FrameTime::Now(); |
| 2697 } | 2698 } |
| 2698 | 2699 |
| 2699 scoped_ptr<base::Value> LayerTreeHostImpl::AsValueWithFrame( | 2700 scoped_ptr<base::Value> LayerTreeHostImpl::AsValueWithFrame( |
| 2700 FrameData* frame) const { | 2701 FrameData* frame) const { |
| 2701 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); | 2702 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
| 2702 if (this->pending_tree_) | 2703 if (this->pending_tree_) |
| 2703 state->Set("activation_state", ActivationStateAsValue().release()); | 2704 state->Set("activation_state", ActivationStateAsValue().release()); |
| 2704 state->Set("device_viewport_size", | 2705 state->Set("device_viewport_size", |
| 2705 MathUtil::AsValue(device_viewport_size_).release()); | 2706 MathUtil::AsValue(device_viewport_size_).release()); |
| 2706 if (tile_manager_) | 2707 if (tile_manager_) |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2816 std::set<UIResourceId>::iterator found_in_evicted = | 2817 std::set<UIResourceId>::iterator found_in_evicted = |
| 2817 evicted_ui_resources_.find(uid); | 2818 evicted_ui_resources_.find(uid); |
| 2818 if (found_in_evicted == evicted_ui_resources_.end()) | 2819 if (found_in_evicted == evicted_ui_resources_.end()) |
| 2819 return; | 2820 return; |
| 2820 evicted_ui_resources_.erase(found_in_evicted); | 2821 evicted_ui_resources_.erase(found_in_evicted); |
| 2821 if (evicted_ui_resources_.empty()) | 2822 if (evicted_ui_resources_.empty()) |
| 2822 client_->OnCanDrawStateChanged(CanDraw()); | 2823 client_->OnCanDrawStateChanged(CanDraw()); |
| 2823 } | 2824 } |
| 2824 | 2825 |
| 2825 } // namespace cc | 2826 } // namespace cc |
| OLD | NEW |