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 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
548 return true; | 548 return true; |
549 } | 549 } |
550 | 550 |
551 // If the layer has a reflection. | 551 // If the layer has a reflection. |
552 if (layer->replica_layer()) { | 552 if (layer->replica_layer()) { |
553 DCHECK(!is_root); | 553 DCHECK(!is_root); |
554 return true; | 554 return true; |
555 } | 555 } |
556 | 556 |
557 // If the layer uses a CSS filter. | 557 // If the layer uses a CSS filter. |
558 if (!layer->filters().IsEmpty() || !layer->background_filters().IsEmpty() || | 558 if (!layer->filters().IsEmpty() || !layer->background_filters().IsEmpty()) { |
559 layer->filter()) { | |
560 DCHECK(!is_root); | 559 DCHECK(!is_root); |
561 return true; | 560 return true; |
562 } | 561 } |
563 | 562 |
564 int num_descendants_that_draw_content = | 563 int num_descendants_that_draw_content = |
565 layer->draw_properties().num_descendants_that_draw_content; | 564 layer->draw_properties().num_descendants_that_draw_content; |
566 | 565 |
567 // If the layer flattens its subtree (i.e. the layer doesn't preserve-3d), but | 566 // If the layer flattens its subtree (i.e. the layer doesn't preserve-3d), but |
568 // it is treated as a 3D object by its parent (i.e. parent does preserve-3d). | 567 // it is treated as a 3D object by its parent (i.e. parent does preserve-3d). |
569 if (LayerIsInExisting3DRenderingContext(layer) && !layer->preserves_3d() && | 568 if (LayerIsInExisting3DRenderingContext(layer) && !layer->preserves_3d() && |
(...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1541 DrawProperties<LayerType, RenderSurfaceType>& | 1540 DrawProperties<LayerType, RenderSurfaceType>& |
1542 replica_mask_draw_properties = | 1541 replica_mask_draw_properties = |
1543 layer->replica_layer()->mask_layer()->draw_properties(); | 1542 layer->replica_layer()->mask_layer()->draw_properties(); |
1544 replica_mask_draw_properties.render_target = layer; | 1543 replica_mask_draw_properties.render_target = layer; |
1545 replica_mask_draw_properties.visible_content_rect = | 1544 replica_mask_draw_properties.visible_content_rect = |
1546 gfx::Rect(layer->content_bounds()); | 1545 gfx::Rect(layer->content_bounds()); |
1547 } | 1546 } |
1548 | 1547 |
1549 // TODO(senorblanco): make this smarter for the SkImageFilter case (check | 1548 // TODO(senorblanco): make this smarter for the SkImageFilter case (check |
1550 // for pixel-moving filters) | 1549 // for pixel-moving filters) |
1551 if (layer->filters().HasFilterThatMovesPixels() || layer->filter()) | 1550 if (layer->filters().HasReferenceFilter() || |
Stephen White
2013/09/11 17:56:25
It occurs to me that HasFilterThatMovesPixels() sh
danakj
2013/09/11 18:01:16
That's true, but elsewhere we check that and then
Stephen White
2013/09/11 18:04:19
Ahh, ok. In that case, ignore me.
| |
1551 layer->filters().HasFilterThatMovesPixels()) | |
1552 nearest_ancestor_surface_that_moves_pixels = render_surface; | 1552 nearest_ancestor_surface_that_moves_pixels = render_surface; |
1553 | 1553 |
1554 render_surface->SetNearestAncestorThatMovesPixels( | 1554 render_surface->SetNearestAncestorThatMovesPixels( |
1555 nearest_ancestor_surface_that_moves_pixels); | 1555 nearest_ancestor_surface_that_moves_pixels); |
1556 | 1556 |
1557 layer_or_ancestor_clips_descendants = false; | 1557 layer_or_ancestor_clips_descendants = false; |
1558 bool subtree_is_clipped_by_surface_bounds = false; | 1558 bool subtree_is_clipped_by_surface_bounds = false; |
1559 if (ancestor_clips_subtree) { | 1559 if (ancestor_clips_subtree) { |
1560 // It may be the layer or the surface doing the clipping of the subtree, | 1560 // It may be the layer or the surface doing the clipping of the subtree, |
1561 // but in either case, we'll be clipping to the projected clip rect of our | 1561 // but in either case, we'll be clipping to the projected clip rect of our |
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2216 // At this point, we think the point does hit the touch event handler region | 2216 // At this point, we think the point does hit the touch event handler region |
2217 // on the layer, but we need to walk up the parents to ensure that the layer | 2217 // on the layer, but we need to walk up the parents to ensure that the layer |
2218 // was not clipped in such a way that the hit point actually should not hit | 2218 // was not clipped in such a way that the hit point actually should not hit |
2219 // the layer. | 2219 // the layer. |
2220 if (PointIsClippedBySurfaceOrClipRect(screen_space_point, layer_impl)) | 2220 if (PointIsClippedBySurfaceOrClipRect(screen_space_point, layer_impl)) |
2221 return false; | 2221 return false; |
2222 | 2222 |
2223 return true; | 2223 return true; |
2224 } | 2224 } |
2225 } // namespace cc | 2225 } // namespace cc |
OLD | NEW |