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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 16871016: cc: Use BeginFrameArgs (Closed) Base URL: http://git.chromium.org/chromium/src.git@bfargs2
Patch Set: fix some tests; needs rebase; Created 7 years, 6 months 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 side-by-side diff with in-line comments
Download patch
Index: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 4fe0871a7adebd7d4e5324fd9542cd8fae785555..9dbf1028bcafd1f8fc9a1eeedc7fca9e13269e57 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -105,23 +105,27 @@ class LayerTreeHostImplTimeSourceAdapter : public TimeSourceClient {
new DebugScopedSetImplThread(layer_tree_host_impl_->proxy()));
}
- // TODO(enne): This should probably happen post-animate.
- if (layer_tree_host_impl_->pending_tree()) {
- layer_tree_host_impl_->ActivatePendingTreeIfNeeded();
-
+ if (layer_tree_host_impl_->settings().impl_side_painting) {
+ layer_tree_host_impl_->BeginFrame(
+ BeginFrameArgs::CreateExpiredForTesting());
+ } else {
if (layer_tree_host_impl_->pending_tree()) {
- layer_tree_host_impl_->pending_tree()->UpdateDrawProperties();
- layer_tree_host_impl_->ManageTiles();
+ layer_tree_host_impl_->ActivatePendingTreeIfNeeded();
+
+ if (layer_tree_host_impl_->pending_tree()) {
+ layer_tree_host_impl_->pending_tree()->UpdateDrawProperties();
+ layer_tree_host_impl_->ManageTiles();
+ }
}
- }
- layer_tree_host_impl_->Animate(
- layer_tree_host_impl_->CurrentFrameTimeTicks(),
- layer_tree_host_impl_->CurrentFrameTime());
- layer_tree_host_impl_->UpdateBackgroundAnimateTicking(true);
- bool start_ready_animations = true;
- layer_tree_host_impl_->UpdateAnimationState(start_ready_animations);
- layer_tree_host_impl_->ResetCurrentFrameTimeForNextFrame();
+ layer_tree_host_impl_->Animate(
+ layer_tree_host_impl_->CurrentFrameTimeTicks(),
+ layer_tree_host_impl_->CurrentFrameTime());
+ layer_tree_host_impl_->UpdateBackgroundAnimateTicking(true);
+ bool start_ready_animations = true;
+ layer_tree_host_impl_->UpdateAnimationState(start_ready_animations);
+ layer_tree_host_impl_->ResetCurrentFrameTimeForNextFrame();
+ }
}
void SetActive(bool active) {
@@ -296,6 +300,7 @@ bool LayerTreeHostImpl::CanDraw() {
void LayerTreeHostImpl::Animate(base::TimeTicks monotonic_time,
base::Time wall_clock_time) {
+ TRACE_EVENT0("cc", __FUNCTION__);
if (input_handler_client_)
input_handler_client_->Animate(monotonic_time);
AnimatePageScale(monotonic_time);
@@ -328,6 +333,7 @@ void LayerTreeHostImpl::StartPageScaleAnimation(gfx::Vector2d target_offset,
float page_scale,
base::TimeTicks start_time,
base::TimeDelta duration) {
+ TRACE_EVENT0("cc", __FUNCTION__);
if (!RootScrollLayer())
return;
@@ -770,7 +776,9 @@ void LayerTreeHostImpl::UpdateBackgroundAnimateTicking(
bool enabled = should_background_tick &&
!animation_registrar_->active_animation_controllers().empty();
-
+ if (animation_registrar_->active_animation_controllers().empty()) {
+ TRACE_EVENT0("cc", "animation_registrar_->active_animation_controllers().empty() == true");
+ }
// Lazily create the time_source adapter so that we can vary the interval for
// testing.
if (!time_source_client_adapter_) {
@@ -1388,6 +1396,7 @@ void LayerTreeHostImpl::ActivatePendingTree() {
// tree, rename the pending tree the recycle tree so we can reuse it on the
// next sync.
pending_tree_.swap(recycle_tree_);
+ client_->DidActivatePendingTree();
recycle_tree_->ClearRenderSurfaces();
active_tree_->SetRootLayerScrollOffsetDelegate(
@@ -1411,7 +1420,6 @@ void LayerTreeHostImpl::ActivatePendingTree() {
stats.total_rasterize_time_for_now_bins_on_pending_tree);
}
- client_->DidActivatePendingTree();
}
void LayerTreeHostImpl::SetVisible(bool visible) {
@@ -2276,6 +2284,7 @@ void LayerTreeHostImpl::UpdateCurrentFrameTime(base::TimeTicks* ticks,
base::Time* now) const {
if (ticks->is_null()) {
DCHECK(now->is_null());
+ TRACE_EVENT0("cc", "UpdateCurrentFrameTime");
*ticks = CurrentPhysicalTimeTicks();
*now = base::Time::Now();
}

Powered by Google App Engine
This is Rietveld 408576698