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 "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "CCLayerTreeHostCommon.h" | 7 #include "CCLayerTreeHostCommon.h" |
8 | 8 |
9 #include "CCLayerImpl.h" | 9 #include "CCLayerImpl.h" |
10 #include "CCLayerIterator.h" | 10 #include "CCLayerIterator.h" |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 | 235 |
236 // If the layer uses a mask. | 236 // If the layer uses a mask. |
237 if (layer->maskLayer()) | 237 if (layer->maskLayer()) |
238 return true; | 238 return true; |
239 | 239 |
240 // If the layer has a reflection. | 240 // If the layer has a reflection. |
241 if (layer->replicaLayer()) | 241 if (layer->replicaLayer()) |
242 return true; | 242 return true; |
243 | 243 |
244 // If the layer uses a CSS filter. | 244 // If the layer uses a CSS filter. |
245 if (!layer->filters().isEmpty() || !layer->backgroundFilters().isEmpty()) | 245 if (!layer->filters().isEmpty() || !layer->backgroundFilters().isEmpty() ||
layer->filter()) |
246 return true; | 246 return true; |
247 | 247 |
248 // If the layer flattens its subtree (i.e. the layer doesn't preserve-3d), b
ut it is | 248 // If the layer flattens its subtree (i.e. the layer doesn't preserve-3d), b
ut it is |
249 // treated as a 3D object by its parent (i.e. parent does preserve-3d). | 249 // treated as a 3D object by its parent (i.e. parent does preserve-3d). |
250 if (layerIsInExisting3DRenderingContext(layer) && !layer->preserves3D() && d
escendantDrawsContent) | 250 if (layerIsInExisting3DRenderingContext(layer) && !layer->preserves3D() && d
escendantDrawsContent) |
251 return true; | 251 return true; |
252 | 252 |
253 // If the layer clips its descendants but it is not axis-aligned with respec
t to its parent. | 253 // If the layer clips its descendants but it is not axis-aligned with respec
t to its parent. |
254 if (layerClipsSubtree(layer) && !axisAlignedWithRespectToParent && descendan
tDrawsContent) | 254 if (layerClipsSubtree(layer) && !axisAlignedWithRespectToParent && descendan
tDrawsContent) |
255 return true; | 255 return true; |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 if (layer->maskLayer()) { | 569 if (layer->maskLayer()) { |
570 layer->maskLayer()->setRenderTarget(layer); | 570 layer->maskLayer()->setRenderTarget(layer); |
571 layer->maskLayer()->setVisibleContentRect(IntRect(IntPoint(), layer-
>contentBounds())); | 571 layer->maskLayer()->setVisibleContentRect(IntRect(IntPoint(), layer-
>contentBounds())); |
572 } | 572 } |
573 | 573 |
574 if (layer->replicaLayer() && layer->replicaLayer()->maskLayer()) { | 574 if (layer->replicaLayer() && layer->replicaLayer()->maskLayer()) { |
575 layer->replicaLayer()->maskLayer()->setRenderTarget(layer); | 575 layer->replicaLayer()->maskLayer()->setRenderTarget(layer); |
576 layer->replicaLayer()->maskLayer()->setVisibleContentRect(IntRect(In
tPoint(), layer->contentBounds())); | 576 layer->replicaLayer()->maskLayer()->setVisibleContentRect(IntRect(In
tPoint(), layer->contentBounds())); |
577 } | 577 } |
578 | 578 |
579 if (layer->filters().hasFilterThatMovesPixels()) | 579 // FIXME: make this smarter for the SkImageFilter case (check for |
| 580 // pixel-moving filters) |
| 581 if (layer->filters().hasFilterThatMovesPixels() || layer->filter()) |
580 nearestAncestorThatMovesPixels = renderSurface; | 582 nearestAncestorThatMovesPixels = renderSurface; |
581 | 583 |
582 // The render surface clipRect is expressed in the space where this surf
ace draws, i.e. the same space as clipRectFromAncestor. | 584 // The render surface clipRect is expressed in the space where this surf
ace draws, i.e. the same space as clipRectFromAncestor. |
583 if (ancestorClipsSubtree) | 585 if (ancestorClipsSubtree) |
584 renderSurface->setClipRect(clipRectFromAncestor); | 586 renderSurface->setClipRect(clipRectFromAncestor); |
585 else | 587 else |
586 renderSurface->setClipRect(IntRect()); | 588 renderSurface->setClipRect(IntRect()); |
587 | 589 |
588 renderSurface->setNearestAncestorThatMovesPixels(nearestAncestorThatMove
sPixels); | 590 renderSurface->setNearestAncestorThatMovesPixels(nearestAncestorThatMove
sPixels); |
589 | 591 |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
855 | 857 |
856 foundLayer = currentLayer; | 858 foundLayer = currentLayer; |
857 break; | 859 break; |
858 } | 860 } |
859 | 861 |
860 // This can potentially return 0, which means the screenSpacePoint did not s
uccessfully hit test any layers, not even the root layer. | 862 // This can potentially return 0, which means the screenSpacePoint did not s
uccessfully hit test any layers, not even the root layer. |
861 return foundLayer; | 863 return foundLayer; |
862 } | 864 } |
863 | 865 |
864 } // namespace cc | 866 } // namespace cc |
OLD | NEW |