| 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 3221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3232 void LayerTreeHostImpl::ResetCurrentBeginFrameArgsForNextFrame() { | 3232 void LayerTreeHostImpl::ResetCurrentBeginFrameArgsForNextFrame() { |
| 3233 current_begin_frame_args_ = BeginFrameArgs(); | 3233 current_begin_frame_args_ = BeginFrameArgs(); |
| 3234 } | 3234 } |
| 3235 | 3235 |
| 3236 BeginFrameArgs LayerTreeHostImpl::CurrentBeginFrameArgs() const { | 3236 BeginFrameArgs LayerTreeHostImpl::CurrentBeginFrameArgs() const { |
| 3237 // Try to use the current frame time to keep animations non-jittery. But if | 3237 // Try to use the current frame time to keep animations non-jittery. But if |
| 3238 // we're not in a frame (because this is during an input event or a delayed | 3238 // we're not in a frame (because this is during an input event or a delayed |
| 3239 // task), fall back to physical time. This should still be monotonic. | 3239 // task), fall back to physical time. This should still be monotonic. |
| 3240 if (current_begin_frame_args_.IsValid()) | 3240 if (current_begin_frame_args_.IsValid()) |
| 3241 return current_begin_frame_args_; | 3241 return current_begin_frame_args_; |
| 3242 return BeginFrameArgs::Create(gfx::FrameTime::Now(), base::TimeTicks(), | 3242 return BeginFrameArgs::Create( |
| 3243 BeginFrameArgs::DefaultInterval(), | 3243 BEGINFRAME_FROM_HERE, gfx::FrameTime::Now(), base::TimeTicks(), |
| 3244 BeginFrameArgs::NORMAL); | 3244 BeginFrameArgs::DefaultInterval(), BeginFrameArgs::NORMAL); |
| 3245 } | 3245 } |
| 3246 | 3246 |
| 3247 scoped_refptr<base::debug::ConvertableToTraceFormat> | 3247 scoped_refptr<base::debug::ConvertableToTraceFormat> |
| 3248 LayerTreeHostImpl::AsValue() const { | 3248 LayerTreeHostImpl::AsValue() const { |
| 3249 return AsValueWithFrame(NULL); | 3249 return AsValueWithFrame(NULL); |
| 3250 } | 3250 } |
| 3251 | 3251 |
| 3252 scoped_refptr<base::debug::ConvertableToTraceFormat> | 3252 scoped_refptr<base::debug::ConvertableToTraceFormat> |
| 3253 LayerTreeHostImpl::AsValueWithFrame(FrameData* frame) const { | 3253 LayerTreeHostImpl::AsValueWithFrame(FrameData* frame) const { |
| 3254 scoped_refptr<base::debug::TracedValue> state = | 3254 scoped_refptr<base::debug::TracedValue> state = |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3479 } | 3479 } |
| 3480 | 3480 |
| 3481 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { | 3481 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { |
| 3482 std::vector<PictureLayerImpl*>::iterator it = | 3482 std::vector<PictureLayerImpl*>::iterator it = |
| 3483 std::find(picture_layers_.begin(), picture_layers_.end(), layer); | 3483 std::find(picture_layers_.begin(), picture_layers_.end(), layer); |
| 3484 DCHECK(it != picture_layers_.end()); | 3484 DCHECK(it != picture_layers_.end()); |
| 3485 picture_layers_.erase(it); | 3485 picture_layers_.erase(it); |
| 3486 } | 3486 } |
| 3487 | 3487 |
| 3488 } // namespace cc | 3488 } // namespace cc |
| OLD | NEW |