| OLD | NEW |
| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 1326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1337 | 1337 |
| 1338 void LayerTreeHost::SetElementScrollOffsetMutated( | 1338 void LayerTreeHost::SetElementScrollOffsetMutated( |
| 1339 ElementId element_id, | 1339 ElementId element_id, |
| 1340 ElementListType list_type, | 1340 ElementListType list_type, |
| 1341 const gfx::ScrollOffset& scroll_offset) { | 1341 const gfx::ScrollOffset& scroll_offset) { |
| 1342 Layer* layer = LayerById(element_id); | 1342 Layer* layer = LayerById(element_id); |
| 1343 DCHECK(layer); | 1343 DCHECK(layer); |
| 1344 layer->OnScrollOffsetAnimated(scroll_offset); | 1344 layer->OnScrollOffsetAnimated(scroll_offset); |
| 1345 } | 1345 } |
| 1346 | 1346 |
| 1347 void LayerTreeHost::ElementTransformIsPotentiallyAnimatingChanged( | 1347 void LayerTreeHost::ElementTransformIsAnimatingChanged( |
| 1348 ElementId element_id, | 1348 ElementId element_id, |
| 1349 ElementListType list_type, | 1349 ElementListType list_type, |
| 1350 AnimationChangeType change_type, |
| 1350 bool is_animating) { | 1351 bool is_animating) { |
| 1351 Layer* layer = LayerById(element_id); | 1352 Layer* layer = LayerById(element_id); |
| 1352 DCHECK(layer); | 1353 if (layer) { |
| 1353 layer->OnTransformIsPotentiallyAnimatingChanged(is_animating); | 1354 switch (change_type) { |
| 1355 case AnimationChangeType::POTENTIAL: |
| 1356 layer->OnTransformIsPotentiallyAnimatingChanged(is_animating); |
| 1357 break; |
| 1358 case AnimationChangeType::RUNNING: |
| 1359 layer->OnTransformIsCurrentlyAnimatingChanged(is_animating); |
| 1360 break; |
| 1361 case AnimationChangeType::BOTH: |
| 1362 layer->OnTransformIsPotentiallyAnimatingChanged(is_animating); |
| 1363 layer->OnTransformIsCurrentlyAnimatingChanged(is_animating); |
| 1364 break; |
| 1365 } |
| 1366 } |
| 1354 } | 1367 } |
| 1355 | 1368 |
| 1356 void LayerTreeHost::ElementOpacityIsAnimatingChanged( | 1369 void LayerTreeHost::ElementOpacityIsAnimatingChanged( |
| 1357 ElementId element_id, | 1370 ElementId element_id, |
| 1358 ElementListType list_type, | 1371 ElementListType list_type, |
| 1359 AnimationChangeType change_type, | 1372 AnimationChangeType change_type, |
| 1360 bool is_animating) { | 1373 bool is_animating) { |
| 1361 Layer* layer = LayerById(element_id); | 1374 Layer* layer = LayerById(element_id); |
| 1362 if (layer) { | 1375 if (layer) { |
| 1363 switch (change_type) { | 1376 switch (change_type) { |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1651 int seq_num = property_trees_.sequence_number; | 1664 int seq_num = property_trees_.sequence_number; |
| 1652 LayerTreeHostCommon::CallFunctionForEveryLayer(this, [seq_num](Layer* layer) { | 1665 LayerTreeHostCommon::CallFunctionForEveryLayer(this, [seq_num](Layer* layer) { |
| 1653 layer->set_property_tree_sequence_number(seq_num); | 1666 layer->set_property_tree_sequence_number(seq_num); |
| 1654 }); | 1667 }); |
| 1655 | 1668 |
| 1656 surface_id_namespace_ = proto.surface_id_namespace(); | 1669 surface_id_namespace_ = proto.surface_id_namespace(); |
| 1657 next_surface_sequence_ = proto.next_surface_sequence(); | 1670 next_surface_sequence_ = proto.next_surface_sequence(); |
| 1658 } | 1671 } |
| 1659 | 1672 |
| 1660 } // namespace cc | 1673 } // namespace cc |
| OLD | NEW |