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

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

Issue 27710005: cc: Use HighResNow as timebase if it is fast and reliable (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix DCHECK Created 7 years, 1 month 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
« no previous file with comments | « cc/test/layer_tree_test.cc ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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
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
2674 UpdateCurrentFrameTime(&current_frame_timeticks_, &current_frame_time_); 2675 UpdateCurrentFrameTime(&current_frame_timeticks_, &current_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(&current_frame_timeticks_, &current_frame_time_); 2680 UpdateCurrentFrameTime(&current_frame_timeticks_, &current_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
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
OLDNEW
« no previous file with comments | « cc/test/layer_tree_test.cc ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698