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