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

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

Issue 742683002: cc: Small BeginFrameArgs cleanup. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Trying to upload again. Created 6 years 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/begin_frame_args_test.cc ('k') | cc/trees/single_thread_proxy.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 3190 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « cc/test/begin_frame_args_test.cc ('k') | cc/trees/single_thread_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698