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