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_common.h" | 5 #include "cc/trees/layer_tree_host_common.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 return CalculateVisibleRectWithCachedLayerRect( | 171 return CalculateVisibleRectWithCachedLayerRect( |
172 visible_rect_in_target_surface_space, | 172 visible_rect_in_target_surface_space, |
173 gfx::Rect(layer->content_bounds()), | 173 gfx::Rect(layer->content_bounds()), |
174 layer_rect_in_target_space, | 174 layer_rect_in_target_space, |
175 layer->draw_transform()); | 175 layer->draw_transform()); |
176 } | 176 } |
177 | 177 |
178 static inline bool TransformToParentIsKnown(LayerImpl* layer) { return true; } | 178 static inline bool TransformToParentIsKnown(LayerImpl* layer) { return true; } |
179 | 179 |
180 static inline bool TransformToParentIsKnown(Layer* layer) { | 180 static inline bool TransformToParentIsKnown(Layer* layer) { |
181 | |
182 return !layer->TransformIsAnimating(); | 181 return !layer->TransformIsAnimating(); |
183 } | 182 } |
184 | 183 |
185 static inline bool TransformToScreenIsKnown(LayerImpl* layer) { return true; } | 184 static inline bool TransformToScreenIsKnown(LayerImpl* layer) { return true; } |
186 | 185 |
187 static inline bool TransformToScreenIsKnown(Layer* layer) { | 186 static inline bool TransformToScreenIsKnown(Layer* layer) { |
188 return !layer->screen_space_transform_is_animating(); | 187 return !layer->screen_space_transform_is_animating(); |
189 } | 188 } |
190 | 189 |
191 template <typename LayerType> | 190 template <typename LayerType> |
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
759 // The replica draw transform to its target surface origin is: | 758 // The replica draw transform to its target surface origin is: |
760 // M[replicaDraw] = S[deviceScale] * M[surfaceDraw] * | 759 // M[replicaDraw] = S[deviceScale] * M[surfaceDraw] * |
761 // Tr[replica->position() + replica->anchor()] * Tr[replica] * | 760 // Tr[replica->position() + replica->anchor()] * Tr[replica] * |
762 // Tr[origin2anchor].inverse() * S[contents_scale].inverse() | 761 // Tr[origin2anchor].inverse() * S[contents_scale].inverse() |
763 // | 762 // |
764 // The replica draw transform to the root (screen space) origin is: | 763 // The replica draw transform to the root (screen space) origin is: |
765 // M[replica2root] = M[surface2root] * Tr[replica->position()] * | 764 // M[replica2root] = M[surface2root] * Tr[replica->position()] * |
766 // Tr[replica] * Tr[origin2anchor].inverse() | 765 // Tr[replica] * Tr[origin2anchor].inverse() |
767 // | 766 // |
768 | 767 |
769 // If we early-exit anywhere in this function, the drawable_content_rect of th
is | 768 // If we early-exit anywhere in this function, the drawable_content_rect of |
770 // subtree should be considered empty. | 769 // this subtree should be considered empty. |
771 *drawable_content_rect_of_subtree = gfx::Rect(); | 770 *drawable_content_rect_of_subtree = gfx::Rect(); |
772 | 771 |
773 // The root layer cannot skip CalcDrawProperties. | 772 // The root layer cannot skip CalcDrawProperties. |
774 if (!IsRootLayer(layer) && SubtreeShouldBeSkipped(layer)) | 773 if (!IsRootLayer(layer) && SubtreeShouldBeSkipped(layer)) |
775 return; | 774 return; |
776 | 775 |
777 // As this function proceeds, these are the properties for the current | 776 // As this function proceeds, these are the properties for the current |
778 // layer that actually get computed. To avoid unnecessary copies | 777 // layer that actually get computed. To avoid unnecessary copies |
779 // (particularly for matrices), we do computations directly on these values | 778 // (particularly for matrices), we do computations directly on these values |
780 // when possible. | 779 // when possible. |
(...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1577 // At this point, we think the point does hit the touch event handler region | 1576 // At this point, we think the point does hit the touch event handler region |
1578 // on the layer, but we need to walk up the parents to ensure that the layer | 1577 // on the layer, but we need to walk up the parents to ensure that the layer |
1579 // was not clipped in such a way that the hit point actually should not hit | 1578 // was not clipped in such a way that the hit point actually should not hit |
1580 // the layer. | 1579 // the layer. |
1581 if (PointIsClippedBySurfaceOrClipRect(screen_space_point, layer_impl)) | 1580 if (PointIsClippedBySurfaceOrClipRect(screen_space_point, layer_impl)) |
1582 return false; | 1581 return false; |
1583 | 1582 |
1584 return true; | 1583 return true; |
1585 } | 1584 } |
1586 } // namespace cc | 1585 } // namespace cc |
OLD | NEW |