| 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 3190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3201 void LayerTreeHostImpl::ResetCurrentBeginFrameArgsForNextFrame() { | 3201 void LayerTreeHostImpl::ResetCurrentBeginFrameArgsForNextFrame() { |
| 3202 current_begin_frame_args_ = BeginFrameArgs(); | 3202 current_begin_frame_args_ = BeginFrameArgs(); |
| 3203 } | 3203 } |
| 3204 | 3204 |
| 3205 BeginFrameArgs LayerTreeHostImpl::CurrentBeginFrameArgs() const { | 3205 BeginFrameArgs LayerTreeHostImpl::CurrentBeginFrameArgs() const { |
| 3206 // Try to use the current frame time to keep animations non-jittery. But if | 3206 // Try to use the current frame time to keep animations non-jittery. But if |
| 3207 // we're not in a frame (because this is during an input event or a delayed | 3207 // we're not in a frame (because this is during an input event or a delayed |
| 3208 // task), fall back to physical time. This should still be monotonic. | 3208 // task), fall back to physical time. This should still be monotonic. |
| 3209 if (current_begin_frame_args_.IsValid()) | 3209 if (current_begin_frame_args_.IsValid()) |
| 3210 return current_begin_frame_args_; | 3210 return current_begin_frame_args_; |
| 3211 return BeginFrameArgs::Create(gfx::FrameTime::Now(), | 3211 return BeginFrameArgs::Create(gfx::FrameTime::Now(), base::TimeTicks(), |
| 3212 base::TimeTicks(), | 3212 BeginFrameArgs::DefaultInterval(), |
| 3213 BeginFrameArgs::DefaultInterval()); | 3213 BeginFrameArgs::NORMAL); |
| 3214 } | 3214 } |
| 3215 | 3215 |
| 3216 scoped_refptr<base::debug::ConvertableToTraceFormat> | 3216 scoped_refptr<base::debug::ConvertableToTraceFormat> |
| 3217 LayerTreeHostImpl::AsValue() const { | 3217 LayerTreeHostImpl::AsValue() const { |
| 3218 return AsValueWithFrame(NULL); | 3218 return AsValueWithFrame(NULL); |
| 3219 } | 3219 } |
| 3220 | 3220 |
| 3221 scoped_refptr<base::debug::ConvertableToTraceFormat> | 3221 scoped_refptr<base::debug::ConvertableToTraceFormat> |
| 3222 LayerTreeHostImpl::AsValueWithFrame(FrameData* frame) const { | 3222 LayerTreeHostImpl::AsValueWithFrame(FrameData* frame) const { |
| 3223 scoped_refptr<base::debug::TracedValue> state = | 3223 scoped_refptr<base::debug::TracedValue> state = |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3448 } | 3448 } |
| 3449 | 3449 |
| 3450 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { | 3450 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { |
| 3451 std::vector<PictureLayerImpl*>::iterator it = | 3451 std::vector<PictureLayerImpl*>::iterator it = |
| 3452 std::find(picture_layers_.begin(), picture_layers_.end(), layer); | 3452 std::find(picture_layers_.begin(), picture_layers_.end(), layer); |
| 3453 DCHECK(it != picture_layers_.end()); | 3453 DCHECK(it != picture_layers_.end()); |
| 3454 picture_layers_.erase(it); | 3454 picture_layers_.erase(it); |
| 3455 } | 3455 } |
| 3456 | 3456 |
| 3457 } // namespace cc | 3457 } // namespace cc |
| OLD | NEW |