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

Unified Diff: cc/trees/layer_tree_host.cc

Issue 1921583003: CC Animation: Let MutatorHostClient deals with elements instead of layers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@elementid
Patch Set: Rename methods in ElementAnimations Created 4 years, 8 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
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host.cc
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index d6c4f3289b8d34ad3b91cd06f45b652147aa4b64..9f64b4f0287da4091622a1b820379cf914d781e0 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -1307,19 +1307,20 @@ void LayerTreeHost::RegisterLayer(Layer* layer) {
DCHECK(!LayerById(layer->id()));
DCHECK(!in_paint_layer_contents_);
layer_id_map_[layer->id()] = layer;
- animation_host_->RegisterLayer(layer->id(), LayerTreeType::ACTIVE);
+ animation_host_->RegisterElement(layer->id(), ElementListType::ACTIVE);
}
void LayerTreeHost::UnregisterLayer(Layer* layer) {
DCHECK(LayerById(layer->id()));
DCHECK(!in_paint_layer_contents_);
- animation_host_->UnregisterLayer(layer->id(), LayerTreeType::ACTIVE);
+ animation_host_->UnregisterElement(layer->id(), ElementListType::ACTIVE);
RemoveLayerShouldPushProperties(layer);
layer_id_map_.erase(layer->id());
}
-bool LayerTreeHost::IsLayerInTree(int layer_id, LayerTreeType tree_type) const {
- return tree_type == LayerTreeType::ACTIVE && LayerById(layer_id);
+bool LayerTreeHost::IsElementInList(ElementId element_id,
+ ElementListType list_type) const {
+ return list_type == ElementListType::ACTIVE && LayerById(element_id);
}
void LayerTreeHost::SetMutatorsNeedCommit() {
@@ -1330,51 +1331,52 @@ void LayerTreeHost::SetMutatorsNeedRebuildPropertyTrees() {
property_trees_.needs_rebuild = true;
}
-void LayerTreeHost::SetLayerFilterMutated(int layer_id,
- LayerTreeType tree_type,
- const FilterOperations& filters) {
- Layer* layer = LayerById(layer_id);
+void LayerTreeHost::SetElementFilterMutated(ElementId element_id,
+ ElementListType list_type,
+ const FilterOperations& filters) {
+ Layer* layer = LayerById(element_id);
DCHECK(layer);
layer->OnFilterAnimated(filters);
}
-void LayerTreeHost::SetLayerOpacityMutated(int layer_id,
- LayerTreeType tree_type,
- float opacity) {
- Layer* layer = LayerById(layer_id);
+void LayerTreeHost::SetElementOpacityMutated(ElementId element_id,
+ ElementListType list_type,
+ float opacity) {
+ Layer* layer = LayerById(element_id);
DCHECK(layer);
layer->OnOpacityAnimated(opacity);
}
-void LayerTreeHost::SetLayerTransformMutated(int layer_id,
- LayerTreeType tree_type,
- const gfx::Transform& transform) {
- Layer* layer = LayerById(layer_id);
+void LayerTreeHost::SetElementTransformMutated(
+ ElementId element_id,
+ ElementListType list_type,
+ const gfx::Transform& transform) {
+ Layer* layer = LayerById(element_id);
DCHECK(layer);
layer->OnTransformAnimated(transform);
}
-void LayerTreeHost::SetLayerScrollOffsetMutated(
- int layer_id,
- LayerTreeType tree_type,
+void LayerTreeHost::SetElementScrollOffsetMutated(
+ ElementId element_id,
+ ElementListType list_type,
const gfx::ScrollOffset& scroll_offset) {
- Layer* layer = LayerById(layer_id);
+ Layer* layer = LayerById(element_id);
DCHECK(layer);
layer->OnScrollOffsetAnimated(scroll_offset);
}
-void LayerTreeHost::LayerTransformIsPotentiallyAnimatingChanged(
- int layer_id,
- LayerTreeType tree_type,
+void LayerTreeHost::ElementTransformIsPotentiallyAnimatingChanged(
+ ElementId element_id,
+ ElementListType list_type,
bool is_animating) {
- Layer* layer = LayerById(layer_id);
+ Layer* layer = LayerById(element_id);
DCHECK(layer);
layer->OnTransformIsPotentiallyAnimatingChanged(is_animating);
}
gfx::ScrollOffset LayerTreeHost::GetScrollOffsetForAnimation(
- int layer_id) const {
- Layer* layer = LayerById(layer_id);
+ ElementId element_id) const {
+ Layer* layer = LayerById(element_id);
DCHECK(layer);
return layer->ScrollOffsetForAnimation();
}
@@ -1386,52 +1388,52 @@ bool LayerTreeHost::ScrollOffsetAnimationWasInterrupted(
bool LayerTreeHost::IsAnimatingFilterProperty(const Layer* layer) const {
return animation_host_->IsAnimatingFilterProperty(layer->id(),
- LayerTreeType::ACTIVE);
+ ElementListType::ACTIVE);
}
bool LayerTreeHost::IsAnimatingOpacityProperty(const Layer* layer) const {
return animation_host_->IsAnimatingOpacityProperty(layer->id(),
- LayerTreeType::ACTIVE);
+ ElementListType::ACTIVE);
}
bool LayerTreeHost::IsAnimatingTransformProperty(const Layer* layer) const {
return animation_host_->IsAnimatingTransformProperty(layer->id(),
- LayerTreeType::ACTIVE);
+ ElementListType::ACTIVE);
}
bool LayerTreeHost::HasPotentiallyRunningFilterAnimation(
const Layer* layer) const {
return animation_host_->HasPotentiallyRunningFilterAnimation(
- layer->id(), LayerTreeType::ACTIVE);
+ layer->id(), ElementListType::ACTIVE);
}
bool LayerTreeHost::HasPotentiallyRunningOpacityAnimation(
const Layer* layer) const {
return animation_host_->HasPotentiallyRunningOpacityAnimation(
- layer->id(), LayerTreeType::ACTIVE);
+ layer->id(), ElementListType::ACTIVE);
}
bool LayerTreeHost::HasPotentiallyRunningTransformAnimation(
const Layer* layer) const {
return animation_host_->HasPotentiallyRunningTransformAnimation(
- layer->id(), LayerTreeType::ACTIVE);
+ layer->id(), ElementListType::ACTIVE);
}
bool LayerTreeHost::HasOnlyTranslationTransforms(const Layer* layer) const {
return animation_host_->HasOnlyTranslationTransforms(layer->id(),
- LayerTreeType::ACTIVE);
+ ElementListType::ACTIVE);
}
bool LayerTreeHost::MaximumTargetScale(const Layer* layer,
float* max_scale) const {
- return animation_host_->MaximumTargetScale(layer->id(), LayerTreeType::ACTIVE,
- max_scale);
+ return animation_host_->MaximumTargetScale(
+ layer->id(), ElementListType::ACTIVE, max_scale);
}
bool LayerTreeHost::AnimationStartScale(const Layer* layer,
float* start_scale) const {
return animation_host_->AnimationStartScale(
- layer->id(), LayerTreeType::ACTIVE, start_scale);
+ layer->id(), ElementListType::ACTIVE, start_scale);
}
bool LayerTreeHost::HasAnyAnimationTargetingProperty(
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698