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 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1540 DrawProperties<LayerType, RenderSurfaceType>& | 1539 DrawProperties<LayerType, RenderSurfaceType>& |
1541 replica_mask_draw_properties = | 1540 replica_mask_draw_properties = |
1542 layer->replica_layer()->mask_layer()->draw_properties(); | 1541 layer->replica_layer()->mask_layer()->draw_properties(); |
1543 replica_mask_draw_properties.render_target = layer; | 1542 replica_mask_draw_properties.render_target = layer; |
1544 replica_mask_draw_properties.visible_content_rect = | 1543 replica_mask_draw_properties.visible_content_rect = |
1545 gfx::Rect(layer->content_bounds()); | 1544 gfx::Rect(layer->content_bounds()); |
1546 } | 1545 } |
1547 | 1546 |
1548 // TODO(senorblanco): make this smarter for the SkImageFilter case (check | 1547 // TODO(senorblanco): make this smarter for the SkImageFilter case (check |
1549 // for pixel-moving filters) | 1548 // for pixel-moving filters) |
1550 if (layer->filters().HasFilterThatMovesPixels() || layer->filter()) | 1549 if (layer->filters().HasFilterThatMovesPixels() || |
1550 layer->filters().HasReferenceFilter()) | |
danakj
2013/09/09 22:04:50
move this to be first so we don't call HasFilterTh
ajuma
2013/09/10 21:17:58
Done.
| |
1551 nearest_ancestor_surface_that_moves_pixels = render_surface; | 1551 nearest_ancestor_surface_that_moves_pixels = render_surface; |
1552 | 1552 |
1553 render_surface->SetNearestAncestorThatMovesPixels( | 1553 render_surface->SetNearestAncestorThatMovesPixels( |
1554 nearest_ancestor_surface_that_moves_pixels); | 1554 nearest_ancestor_surface_that_moves_pixels); |
1555 | 1555 |
1556 layer_or_ancestor_clips_descendants = false; | 1556 layer_or_ancestor_clips_descendants = false; |
1557 bool subtree_is_clipped_by_surface_bounds = false; | 1557 bool subtree_is_clipped_by_surface_bounds = false; |
1558 if (ancestor_clips_subtree) { | 1558 if (ancestor_clips_subtree) { |
1559 // It may be the layer or the surface doing the clipping of the subtree, | 1559 // It may be the layer or the surface doing the clipping of the subtree, |
1560 // but in either case, we'll be clipping to the projected clip rect of our | 1560 // 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... | |
2215 // At this point, we think the point does hit the touch event handler region | 2215 // At this point, we think the point does hit the touch event handler region |
2216 // on the layer, but we need to walk up the parents to ensure that the layer | 2216 // on the layer, but we need to walk up the parents to ensure that the layer |
2217 // was not clipped in such a way that the hit point actually should not hit | 2217 // was not clipped in such a way that the hit point actually should not hit |
2218 // the layer. | 2218 // the layer. |
2219 if (PointIsClippedBySurfaceOrClipRect(screen_space_point, layer_impl)) | 2219 if (PointIsClippedBySurfaceOrClipRect(screen_space_point, layer_impl)) |
2220 return false; | 2220 return false; |
2221 | 2221 |
2222 return true; | 2222 return true; |
2223 } | 2223 } |
2224 } // namespace cc | 2224 } // namespace cc |
OLD | NEW |