| 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 1451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1462 } | 1462 } |
| 1463 } | 1463 } |
| 1464 | 1464 |
| 1465 gfx::ScrollOffset LayerTreeHost::GetScrollOffsetForAnimation( | 1465 gfx::ScrollOffset LayerTreeHost::GetScrollOffsetForAnimation( |
| 1466 ElementId element_id) const { | 1466 ElementId element_id) const { |
| 1467 Layer* layer = LayerByElementId(element_id); | 1467 Layer* layer = LayerByElementId(element_id); |
| 1468 DCHECK(layer); | 1468 DCHECK(layer); |
| 1469 return layer->ScrollOffsetForAnimation(); | 1469 return layer->ScrollOffsetForAnimation(); |
| 1470 } | 1470 } |
| 1471 | 1471 |
| 1472 bool LayerTreeHost::ScrollOffsetAnimationWasInterrupted( | |
| 1473 const Layer* layer) const { | |
| 1474 return animation_host_->ScrollOffsetAnimationWasInterrupted( | |
| 1475 layer->element_id()); | |
| 1476 } | |
| 1477 | |
| 1478 bool LayerTreeHost::IsAnimatingFilterProperty(const Layer* layer) const { | |
| 1479 return animation_host_->IsAnimatingFilterProperty(layer->element_id(), | |
| 1480 ElementListType::ACTIVE); | |
| 1481 } | |
| 1482 | |
| 1483 bool LayerTreeHost::IsAnimatingOpacityProperty(const Layer* layer) const { | |
| 1484 return animation_host_->IsAnimatingOpacityProperty(layer->element_id(), | |
| 1485 ElementListType::ACTIVE); | |
| 1486 } | |
| 1487 | |
| 1488 bool LayerTreeHost::IsAnimatingTransformProperty(const Layer* layer) const { | |
| 1489 return animation_host_->IsAnimatingTransformProperty(layer->element_id(), | |
| 1490 ElementListType::ACTIVE); | |
| 1491 } | |
| 1492 | |
| 1493 bool LayerTreeHost::HasPotentiallyRunningFilterAnimation( | |
| 1494 const Layer* layer) const { | |
| 1495 return animation_host_->HasPotentiallyRunningFilterAnimation( | |
| 1496 layer->element_id(), ElementListType::ACTIVE); | |
| 1497 } | |
| 1498 | |
| 1499 bool LayerTreeHost::HasPotentiallyRunningOpacityAnimation( | |
| 1500 const Layer* layer) const { | |
| 1501 return animation_host_->HasPotentiallyRunningOpacityAnimation( | |
| 1502 layer->element_id(), ElementListType::ACTIVE); | |
| 1503 } | |
| 1504 | |
| 1505 bool LayerTreeHost::HasPotentiallyRunningTransformAnimation( | |
| 1506 const Layer* layer) const { | |
| 1507 return animation_host_->HasPotentiallyRunningTransformAnimation( | |
| 1508 layer->element_id(), ElementListType::ACTIVE); | |
| 1509 } | |
| 1510 | |
| 1511 bool LayerTreeHost::HasOnlyTranslationTransforms(const Layer* layer) const { | |
| 1512 return animation_host_->HasOnlyTranslationTransforms(layer->element_id(), | |
| 1513 ElementListType::ACTIVE); | |
| 1514 } | |
| 1515 | |
| 1516 bool LayerTreeHost::MaximumTargetScale(const Layer* layer, | |
| 1517 float* max_scale) const { | |
| 1518 return animation_host_->MaximumTargetScale( | |
| 1519 layer->element_id(), ElementListType::ACTIVE, max_scale); | |
| 1520 } | |
| 1521 | |
| 1522 bool LayerTreeHost::AnimationStartScale(const Layer* layer, | |
| 1523 float* start_scale) const { | |
| 1524 return animation_host_->AnimationStartScale( | |
| 1525 layer->element_id(), ElementListType::ACTIVE, start_scale); | |
| 1526 } | |
| 1527 | |
| 1528 bool LayerTreeHost::HasAnyAnimationTargetingProperty( | |
| 1529 const Layer* layer, | |
| 1530 TargetProperty::Type property) const { | |
| 1531 return animation_host_->HasAnyAnimationTargetingProperty(layer->element_id(), | |
| 1532 property); | |
| 1533 } | |
| 1534 | |
| 1535 bool LayerTreeHost::AnimationsPreserveAxisAlignment(const Layer* layer) const { | |
| 1536 return animation_host_->AnimationsPreserveAxisAlignment(layer->element_id()); | |
| 1537 } | |
| 1538 | |
| 1539 bool LayerTreeHost::HasAnyAnimation(const Layer* layer) const { | |
| 1540 return animation_host_->HasAnyAnimation(layer->element_id()); | |
| 1541 } | |
| 1542 | |
| 1543 bool LayerTreeHost::HasActiveAnimationForTesting(const Layer* layer) const { | |
| 1544 return animation_host_->HasActiveAnimationForTesting(layer->element_id()); | |
| 1545 } | |
| 1546 | |
| 1547 bool LayerTreeHost::IsSingleThreaded() const { | 1472 bool LayerTreeHost::IsSingleThreaded() const { |
| 1548 DCHECK(compositor_mode_ != CompositorMode::SINGLE_THREADED || | 1473 DCHECK(compositor_mode_ != CompositorMode::SINGLE_THREADED || |
| 1549 !task_runner_provider_->HasImplThread()); | 1474 !task_runner_provider_->HasImplThread()); |
| 1550 return compositor_mode_ == CompositorMode::SINGLE_THREADED; | 1475 return compositor_mode_ == CompositorMode::SINGLE_THREADED; |
| 1551 } | 1476 } |
| 1552 | 1477 |
| 1553 bool LayerTreeHost::IsThreaded() const { | 1478 bool LayerTreeHost::IsThreaded() const { |
| 1554 DCHECK(compositor_mode_ != CompositorMode::THREADED || | 1479 DCHECK(compositor_mode_ != CompositorMode::THREADED || |
| 1555 task_runner_provider_->HasImplThread()); | 1480 task_runner_provider_->HasImplThread()); |
| 1556 return compositor_mode_ == CompositorMode::THREADED; | 1481 return compositor_mode_ == CompositorMode::THREADED; |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1762 int seq_num = property_trees_.sequence_number; | 1687 int seq_num = property_trees_.sequence_number; |
| 1763 LayerTreeHostCommon::CallFunctionForEveryLayer(this, [seq_num](Layer* layer) { | 1688 LayerTreeHostCommon::CallFunctionForEveryLayer(this, [seq_num](Layer* layer) { |
| 1764 layer->set_property_tree_sequence_number(seq_num); | 1689 layer->set_property_tree_sequence_number(seq_num); |
| 1765 }); | 1690 }); |
| 1766 | 1691 |
| 1767 surface_id_namespace_ = proto.surface_id_namespace(); | 1692 surface_id_namespace_ = proto.surface_id_namespace(); |
| 1768 next_surface_sequence_ = proto.next_surface_sequence(); | 1693 next_surface_sequence_ = proto.next_surface_sequence(); |
| 1769 } | 1694 } |
| 1770 | 1695 |
| 1771 } // namespace cc | 1696 } // namespace cc |
| OLD | NEW |