| 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_impl.h" | 5 #include "cc/trees/layer_tree_impl.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 1775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1786 surface_layers_.push_back(layer); | 1786 surface_layers_.push_back(layer); |
| 1787 } | 1787 } |
| 1788 | 1788 |
| 1789 void LayerTreeImpl::RemoveSurfaceLayer(LayerImpl* layer) { | 1789 void LayerTreeImpl::RemoveSurfaceLayer(LayerImpl* layer) { |
| 1790 LayerImplList::iterator it = | 1790 LayerImplList::iterator it = |
| 1791 std::find(surface_layers_.begin(), surface_layers_.end(), layer); | 1791 std::find(surface_layers_.begin(), surface_layers_.end(), layer); |
| 1792 DCHECK(it != surface_layers_.end()); | 1792 DCHECK(it != surface_layers_.end()); |
| 1793 surface_layers_.erase(it); | 1793 surface_layers_.erase(it); |
| 1794 } | 1794 } |
| 1795 | 1795 |
| 1796 template <typename LayerType> | |
| 1797 static inline bool LayerClipsSubtree(LayerType* layer) { | |
| 1798 return layer->masks_to_bounds() || layer->mask_layer(); | |
| 1799 } | |
| 1800 | |
| 1801 static bool PointHitsRect( | 1796 static bool PointHitsRect( |
| 1802 const gfx::PointF& screen_space_point, | 1797 const gfx::PointF& screen_space_point, |
| 1803 const gfx::Transform& local_space_to_screen_space_transform, | 1798 const gfx::Transform& local_space_to_screen_space_transform, |
| 1804 const gfx::Rect& local_space_rect, | 1799 const gfx::Rect& local_space_rect, |
| 1805 float* distance_to_camera) { | 1800 float* distance_to_camera) { |
| 1806 // If the transform is not invertible, then assume that this point doesn't hit | 1801 // If the transform is not invertible, then assume that this point doesn't hit |
| 1807 // this rect. | 1802 // this rect. |
| 1808 gfx::Transform inverse_local_space_to_screen_space( | 1803 gfx::Transform inverse_local_space_to_screen_space( |
| 1809 gfx::Transform::kSkipInitialization); | 1804 gfx::Transform::kSkipInitialization); |
| 1810 if (!local_space_to_screen_space_transform.GetInverse( | 1805 if (!local_space_to_screen_space_transform.GetInverse( |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2188 | 2183 |
| 2189 void LayerTreeImpl::ResetAllChangeTracking() { | 2184 void LayerTreeImpl::ResetAllChangeTracking() { |
| 2190 layers_that_should_push_properties_.clear(); | 2185 layers_that_should_push_properties_.clear(); |
| 2191 // Iterate over all layers, including masks. | 2186 // Iterate over all layers, including masks. |
| 2192 for (auto& layer : *layers_) | 2187 for (auto& layer : *layers_) |
| 2193 layer->ResetChangeTracking(); | 2188 layer->ResetChangeTracking(); |
| 2194 property_trees_.ResetAllChangeTracking(); | 2189 property_trees_.ResetAllChangeTracking(); |
| 2195 } | 2190 } |
| 2196 | 2191 |
| 2197 } // namespace cc | 2192 } // namespace cc |
| OLD | NEW |