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

Unified Diff: cc/layers/layer_impl.cc

Issue 2755803003: cc: Remove SetNeedsCommitNoRebuild from Layer API (Closed)
Patch Set: check for LTH Created 3 years, 9 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/layers/layer.cc ('k') | cc/layers/surface_layer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer_impl.cc
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index 4dd916142f238f90511407e0cd3dada6c0e2c9df..35d03e225bffe8783a3a75d8b2ca0c85befe775d 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -485,7 +485,7 @@ int LayerImpl::num_copy_requests_in_target_subtree() {
void LayerImpl::UpdatePropertyTreeTransformIsAnimated(bool is_animated) {
if (TransformNode* node =
- GetTransformTree().FindNodeFromOwningLayerId(id())) {
+ GetTransformTree().UpdateNodeFromOwningLayerId(id())) {
// A LayerImpl's own current state is insufficient for determining whether
// it owns a TransformNode, since this depends on the state of the
// corresponding Layer at the time of the last commit. For example, if
@@ -527,14 +527,16 @@ void LayerImpl::OnIsAnimatingChanged(const PropertyAnimationState& mask,
const PropertyAnimationState& state) {
DCHECK(layer_tree_impl_);
- TransformNode* transform_node =
- GetTransformTree().FindNodeFromOwningLayerId(id());
- EffectNode* effect_node = GetEffectTree().FindNodeFromOwningLayerId(id());
for (int property = TargetProperty::FIRST_TARGET_PROPERTY;
property <= TargetProperty::LAST_TARGET_PROPERTY; ++property) {
+ if (!mask.currently_running[property] &&
+ !mask.potentially_animating[property])
+ continue;
+
switch (property) {
case TargetProperty::TRANSFORM:
- if (transform_node) {
+ if (TransformNode* transform_node =
+ GetTransformTree().UpdateNodeFromOwningLayerId(id())) {
if (mask.currently_running[property])
transform_node->is_currently_animating =
state.currently_running[property];
@@ -546,7 +548,8 @@ void LayerImpl::OnIsAnimatingChanged(const PropertyAnimationState& mask,
}
break;
case TargetProperty::OPACITY:
- if (effect_node) {
+ if (EffectNode* effect_node =
+ GetEffectTree().UpdateNodeFromOwningLayerId(id())) {
if (mask.currently_running[property])
effect_node->is_currently_animating_opacity =
state.currently_running[property];
@@ -558,7 +561,8 @@ void LayerImpl::OnIsAnimatingChanged(const PropertyAnimationState& mask,
}
break;
case TargetProperty::FILTER:
- if (effect_node) {
+ if (EffectNode* effect_node =
+ GetEffectTree().UpdateNodeFromOwningLayerId(id())) {
if (mask.currently_running[property])
effect_node->is_currently_animating_filter =
state.currently_running[property];
@@ -618,9 +622,9 @@ void LayerImpl::SetBoundsDelta(const gfx::Vector2dF& bounds_delta) {
if (masks_to_bounds()) {
// If layer is clipping, then update the clip node using the new bounds.
- ClipNode* clip_node = property_trees->clip_tree.Node(clip_tree_index());
- if (clip_node) {
- DCHECK_EQ(clip_node, GetClipTree().FindNodeFromOwningLayerId(id()));
+ if (ClipNode* clip_node =
+ property_trees->clip_tree.UpdateNodeFromOwningLayerId(id())) {
+ DCHECK_EQ(clip_node->id, clip_tree_index());
clip_node->clip = gfx::RectF(gfx::PointF() + offset_to_transform_parent(),
gfx::SizeF(bounds()));
property_trees->clip_tree.set_needs_update(true);
@@ -684,7 +688,7 @@ void LayerImpl::SetContentsOpaque(bool opaque) {
}
float LayerImpl::Opacity() const {
- if (EffectNode* node = GetEffectTree().FindNodeFromOwningLayerId(id()))
+ if (const EffectNode* node = GetEffectTree().FindNodeFromOwningLayerId(id()))
return node->opacity;
else
return 1.f;
« no previous file with comments | « cc/layers/layer.cc ('k') | cc/layers/surface_layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698