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

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

Issue 1009233002: CC Animations: Port Impl-only-scrolling to use compositor animation timelines. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ui
Patch Set: Revert AnimationHost::thread_instance_ deletion back. Created 5 years, 5 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 unified diff | Download patch
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.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <stack> 8 #include <stack>
9 #include <string> 9 #include <string>
10 10
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 next_commit_forces_redraw_(false), 117 next_commit_forces_redraw_(false),
118 shared_bitmap_manager_(params->shared_bitmap_manager), 118 shared_bitmap_manager_(params->shared_bitmap_manager),
119 gpu_memory_buffer_manager_(params->gpu_memory_buffer_manager), 119 gpu_memory_buffer_manager_(params->gpu_memory_buffer_manager),
120 task_graph_runner_(params->task_graph_runner), 120 task_graph_runner_(params->task_graph_runner),
121 surface_id_namespace_(0u), 121 surface_id_namespace_(0u),
122 next_surface_sequence_(1u) { 122 next_surface_sequence_(1u) {
123 DCHECK(task_graph_runner_); 123 DCHECK(task_graph_runner_);
124 124
125 if (settings_.accelerated_animation_enabled) { 125 if (settings_.accelerated_animation_enabled) {
126 if (settings_.use_compositor_animation_timelines) { 126 if (settings_.use_compositor_animation_timelines) {
127 animation_host_ = AnimationHost::Create(); 127 animation_host_ = AnimationHost::Create(ThreadInstance::MAIN);
128 animation_host_->SetMutatorHostClient(this); 128 animation_host_->SetMutatorHostClient(this);
129 } else { 129 } else {
130 animation_registrar_ = AnimationRegistrar::Create(); 130 animation_registrar_ = AnimationRegistrar::Create();
131 } 131 }
132 } 132 }
133 133
134 rendering_stats_instrumentation_->set_record_rendering_stats( 134 rendering_stats_instrumentation_->set_record_rendering_stats(
135 debug_state_.RecordRenderingStats()); 135 debug_state_.RecordRenderingStats());
136 } 136 }
137 137
(...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after
1142 1142
1143 void LayerTreeHost::SetLayerScrollOffsetMutated( 1143 void LayerTreeHost::SetLayerScrollOffsetMutated(
1144 int layer_id, 1144 int layer_id,
1145 LayerTreeType tree_type, 1145 LayerTreeType tree_type,
1146 const gfx::ScrollOffset& scroll_offset) { 1146 const gfx::ScrollOffset& scroll_offset) {
1147 LayerAnimationValueObserver* layer = LayerById(layer_id); 1147 LayerAnimationValueObserver* layer = LayerById(layer_id);
1148 DCHECK(layer); 1148 DCHECK(layer);
1149 layer->OnScrollOffsetAnimated(scroll_offset); 1149 layer->OnScrollOffsetAnimated(scroll_offset);
1150 } 1150 }
1151 1151
1152 gfx::ScrollOffset LayerTreeHost::GetScrollOffsetForAnimation(
1153 int layer_id) const {
1154 LayerAnimationValueProvider* layer = LayerById(layer_id);
1155 DCHECK(layer);
1156 return layer->ScrollOffsetForAnimation();
1157 }
1158
1152 bool LayerTreeHost::ScrollOffsetAnimationWasInterrupted( 1159 bool LayerTreeHost::ScrollOffsetAnimationWasInterrupted(
1153 const Layer* layer) const { 1160 const Layer* layer) const {
1154 return animation_host_ 1161 return animation_host_
1155 ? animation_host_->ScrollOffsetAnimationWasInterrupted(layer->id()) 1162 ? animation_host_->ScrollOffsetAnimationWasInterrupted(layer->id())
1156 : false; 1163 : false;
1157 } 1164 }
1158 1165
1159 bool LayerTreeHost::IsAnimatingFilterProperty(const Layer* layer) const { 1166 bool LayerTreeHost::IsAnimatingFilterProperty(const Layer* layer) const {
1160 return animation_host_ 1167 return animation_host_
1161 ? animation_host_->IsAnimatingFilterProperty(layer->id()) 1168 ? animation_host_->IsAnimatingFilterProperty(layer->id())
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
1200 return animation_host_ ? animation_host_->HasAnyAnimation(layer->id()) 1207 return animation_host_ ? animation_host_->HasAnyAnimation(layer->id())
1201 : false; 1208 : false;
1202 } 1209 }
1203 1210
1204 bool LayerTreeHost::HasActiveAnimation(const Layer* layer) const { 1211 bool LayerTreeHost::HasActiveAnimation(const Layer* layer) const {
1205 return animation_host_ ? animation_host_->HasActiveAnimation(layer->id()) 1212 return animation_host_ ? animation_host_->HasActiveAnimation(layer->id())
1206 : false; 1213 : false;
1207 } 1214 }
1208 1215
1209 } // namespace cc 1216 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698