| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 // contains this squashed layer's clipping ancestor. The clip rect is | 481 // contains this squashed layer's clipping ancestor. The clip rect is |
| 482 // returned in the coordinate space of the given squashed layer. If there is | 482 // returned in the coordinate space of the given squashed layer. If there is |
| 483 // no such containing layer, returns the infinite rect. | 483 // no such containing layer, returns the infinite rect. |
| 484 // FIXME: unify this code with the code that sets up m_ancestorClippingLayer. | 484 // FIXME: unify this code with the code that sets up m_ancestorClippingLayer. |
| 485 // They are doing very similar things. | 485 // They are doing very similar things. |
| 486 static IntRect LocalClipRectForSquashedLayer( | 486 static IntRect LocalClipRectForSquashedLayer( |
| 487 const PaintLayer& reference_layer, | 487 const PaintLayer& reference_layer, |
| 488 const GraphicsLayerPaintInfo&, | 488 const GraphicsLayerPaintInfo&, |
| 489 const Vector<GraphicsLayerPaintInfo>& layers); | 489 const Vector<GraphicsLayerPaintInfo>& layers); |
| 490 | 490 |
| 491 // Conservatively check that a border-radius clip does not clip a child. | 491 // Conservatively check that a sequence of border-radius clips do not clip |
| 492 // this layer. The compositing_ancestor is the nearest compositing ancestor |
| 493 // layer and we can stop checking clips at that layer because higher layer |
| 494 // clips will be applied elsewhere. |
| 492 // This is a fast approximate test. Depending on the shape of the child and | 495 // This is a fast approximate test. Depending on the shape of the child and |
| 493 // the size of the border radius, this method may return false when in fact | 496 // the size of the clips, this method may return false when in fact |
| 494 // the child is not clipped. We accept the approximation because most border | 497 // the child is not clipped. We accept the approximation because most border |
| 495 // radii are small and the outcome is used to reduce the number of layers, | 498 // radii are small and the outcome is used to reduce the number of layers, |
| 496 // not influence correctness. | 499 // not influence correctness. |
| 497 bool AncestorRoundedCornersWontClip( | 500 bool AncestorRoundedCornersWontClip(const PaintLayer* compositing_ancestor); |
| 498 const LayoutBoxModelObject& child, | |
| 499 const LayoutBoxModelObject& clipping_ancestor); | |
| 500 | 501 |
| 501 // Return true in |owningLayerIsClipped| iff |m_owningLayer|'s compositing | 502 // Return true in |owningLayerIsClipped| iff |m_owningLayer|'s compositing |
| 502 // ancestor is not a descendant (inclusive) of the clipping container for | 503 // ancestor is not a descendant (inclusive) of the clipping container for |
| 503 // |m_owningLayer|. Return true in |owningLayerIsMasked| iff | 504 // |m_owningLayer|. Return true in |owningLayerIsMasked| iff |
| 504 // |owningLayerIsClipped| is true and |m_owningLayer|'s compositing ancestor | 505 // |owningLayerIsClipped| is true and |m_owningLayer|'s compositing ancestor |
| 505 // is not a descendant (inclusive) of a container that applies a mask for | 506 // is not a descendant (inclusive) of a container that applies a mask for |
| 506 // |m_owningLayer|. | 507 // |m_owningLayer|. |
| 507 void OwningLayerClippedOrMaskedByLayerNotAboveCompositedAncestor( | 508 void OwningLayerClippedOrMaskedByLayerNotAboveCompositedAncestor( |
| 508 const PaintLayer* scroll_parent, | 509 const PaintLayer* scroll_parent, |
| 509 bool& owning_layer_is_clipped, | 510 bool& owning_layer_is_clipped, |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 707 unsigned background_paints_onto_graphics_layer_ : 1; | 708 unsigned background_paints_onto_graphics_layer_ : 1; |
| 708 | 709 |
| 709 bool draws_background_onto_content_layer_; | 710 bool draws_background_onto_content_layer_; |
| 710 | 711 |
| 711 friend class CompositedLayerMappingTest; | 712 friend class CompositedLayerMappingTest; |
| 712 }; | 713 }; |
| 713 | 714 |
| 714 } // namespace blink | 715 } // namespace blink |
| 715 | 716 |
| 716 #endif // CompositedLayerMapping_h | 717 #endif // CompositedLayerMapping_h |
| OLD | NEW |