| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 bool hasChildTransformLayer() const { return m_childTransformLayer.get(); } | 121 bool hasChildTransformLayer() const { return m_childTransformLayer.get(); } |
| 122 GraphicsLayer* childTransformLayer() const { return m_childTransformLayer.ge
t(); } | 122 GraphicsLayer* childTransformLayer() const { return m_childTransformLayer.ge
t(); } |
| 123 | 123 |
| 124 GraphicsLayer* squashingContainmentLayer() const { return m_squashingContain
mentLayer.get(); } | 124 GraphicsLayer* squashingContainmentLayer() const { return m_squashingContain
mentLayer.get(); } |
| 125 GraphicsLayer* squashingLayer() const { return m_squashingLayer.get(); } | 125 GraphicsLayer* squashingLayer() const { return m_squashingLayer.get(); } |
| 126 | 126 |
| 127 void setSquashingContentsNeedDisplay(); | 127 void setSquashingContentsNeedDisplay(); |
| 128 void setContentsNeedDisplay(); | 128 void setContentsNeedDisplay(); |
| 129 // LayoutRect is in the coordinate space of the layer's layout object. | 129 // LayoutRect is in the coordinate space of the layer's layout object. |
| 130 void setContentsNeedDisplayInRect(const LayoutRect&, PaintInvalidationReason
, const DisplayItemClient&); | 130 void setContentsNeedDisplayInRect(const LayoutRect&, PaintInvalidationReason
, const DisplayItemClient&); |
| 131 // Invalidates just scrolling content layers. |
| 132 void setScrollingContentsNeedDisplayInRect(const LayoutRect&, PaintInvalidat
ionReason, const DisplayItemClient&); |
| 131 | 133 |
| 132 // This is called only if we are tracking paint invalidation for testing, or
ENABLE(ASSERT) | 134 // This is called only if we are tracking paint invalidation for testing, or
ENABLE(ASSERT) |
| 133 // for error checking and debugging. | 135 // for error checking and debugging. |
| 134 void displayItemClientWasInvalidated(const DisplayItemClient&, PaintInvalida
tionReason); | 136 void displayItemClientWasInvalidated(const DisplayItemClient&, PaintInvalida
tionReason); |
| 135 | 137 |
| 136 // Notification from the layoutObject that its content changed. | 138 // Notification from the layoutObject that its content changed. |
| 137 void contentChanged(ContentChangeType); | 139 void contentChanged(ContentChangeType); |
| 138 | 140 |
| 139 LayoutRect compositedBounds() const { return m_compositedBounds; } | 141 LayoutRect compositedBounds() const { return m_compositedBounds; } |
| 140 IntRect pixelSnappedCompositedBounds() const; | 142 IntRect pixelSnappedCompositedBounds() const; |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 LayoutPoint squashingOffsetFromTransformedAncestor() | 211 LayoutPoint squashingOffsetFromTransformedAncestor() |
| 210 { | 212 { |
| 211 return m_squashingLayerOffsetFromTransformedAncestor; | 213 return m_squashingLayerOffsetFromTransformedAncestor; |
| 212 } | 214 } |
| 213 | 215 |
| 214 // If there is a squashed layer painting into this CLM that is an ancestor o
f the given LayoutObject, return it. Otherwise return nullptr. | 216 // If there is a squashed layer painting into this CLM that is an ancestor o
f the given LayoutObject, return it. Otherwise return nullptr. |
| 215 const GraphicsLayerPaintInfo* containingSquashedLayer(const LayoutObject*, u
nsigned maxSquashedLayerIndex); | 217 const GraphicsLayerPaintInfo* containingSquashedLayer(const LayoutObject*, u
nsigned maxSquashedLayerIndex); |
| 216 | 218 |
| 217 void updateScrollingBlockSelection(); | 219 void updateScrollingBlockSelection(); |
| 218 | 220 |
| 221 void adjustForCompositedScrolling(const GraphicsLayer*, IntSize& offset) con
st; |
| 222 |
| 219 private: | 223 private: |
| 220 IntRect recomputeInterestRect(const GraphicsLayer*) const; | 224 IntRect recomputeInterestRect(const GraphicsLayer*) const; |
| 221 static bool interestRectChangedEnoughToRepaint(const IntRect& previousIntere
stRect, const IntRect& newInterestRect, const IntSize& layerSize); | 225 static bool interestRectChangedEnoughToRepaint(const IntRect& previousIntere
stRect, const IntRect& newInterestRect, const IntSize& layerSize); |
| 222 | 226 |
| 223 static const GraphicsLayerPaintInfo* containingSquashedLayer(const LayoutObj
ect*, const Vector<GraphicsLayerPaintInfo>& layers, unsigned maxSquashedLayerIn
dex); | 227 static const GraphicsLayerPaintInfo* containingSquashedLayer(const LayoutObj
ect*, const Vector<GraphicsLayerPaintInfo>& layers, unsigned maxSquashedLayerIn
dex); |
| 224 | 228 |
| 225 // Paints the scrollbar part associated with the given graphics layer into t
he given context. | 229 // Paints the scrollbar part associated with the given graphics layer into t
he given context. |
| 226 void paintScrollableArea(const GraphicsLayer*, GraphicsContext&, const IntRe
ct& interestRect) const; | 230 void paintScrollableArea(const GraphicsLayer*, GraphicsContext&, const IntRe
ct& interestRect) const; |
| 227 // Returns whether the given layer is part of the scrollable area, if any, a
ssociated with this mapping. | 231 // Returns whether the given layer is part of the scrollable area, if any, a
ssociated with this mapping. |
| 228 bool isScrollableAreaLayer(const GraphicsLayer*) const; | 232 bool isScrollableAreaLayer(const GraphicsLayer*) const; |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 // Stacking children of a squashed layer receive graphics layers that are pa
rented to the compositd ancestor of the | 437 // Stacking children of a squashed layer receive graphics layers that are pa
rented to the compositd ancestor of the |
| 434 // squashed layer (i.e. nearest enclosing composited layer that is not squas
hed). | 438 // squashed layer (i.e. nearest enclosing composited layer that is not squas
hed). |
| 435 OwnPtr<GraphicsLayer> m_squashingContainmentLayer; // Only used if any squas
hed layers exist and m_squashingContainmentLayer is not present, to contain the
squashed layers as siblings to the rest of the GraphicsLayer tree chunk. | 439 OwnPtr<GraphicsLayer> m_squashingContainmentLayer; // Only used if any squas
hed layers exist and m_squashingContainmentLayer is not present, to contain the
squashed layers as siblings to the rest of the GraphicsLayer tree chunk. |
| 436 OwnPtr<GraphicsLayer> m_squashingLayer; // Only used if any squashed layers
exist, this is the backing that squashed layers paint into. | 440 OwnPtr<GraphicsLayer> m_squashingLayer; // Only used if any squashed layers
exist, this is the backing that squashed layers paint into. |
| 437 Vector<GraphicsLayerPaintInfo> m_squashedLayers; | 441 Vector<GraphicsLayerPaintInfo> m_squashedLayers; |
| 438 LayoutPoint m_squashingLayerOffsetFromTransformedAncestor; | 442 LayoutPoint m_squashingLayerOffsetFromTransformedAncestor; |
| 439 | 443 |
| 440 LayoutRect m_compositedBounds; | 444 LayoutRect m_compositedBounds; |
| 441 | 445 |
| 442 LayoutSize m_contentOffsetInCompositingLayer; | 446 LayoutSize m_contentOffsetInCompositingLayer; |
| 447 |
| 448 // We keep track of the scrolling contents offset, so that when it changes w
e can notify the ScrollingCoordinator, which |
| 449 // passes on main-thread scrolling updates to the compositor. |
| 450 DoubleSize m_scrollingContentsOffset; |
| 451 |
| 443 unsigned m_contentOffsetInCompositingLayerDirty : 1; | 452 unsigned m_contentOffsetInCompositingLayerDirty : 1; |
| 444 | 453 |
| 445 unsigned m_pendingUpdateScope : 2; | 454 unsigned m_pendingUpdateScope : 2; |
| 446 unsigned m_isMainFrameLayoutViewLayer : 1; | 455 unsigned m_isMainFrameLayoutViewLayer : 1; |
| 447 | 456 |
| 448 unsigned m_backgroundLayerPaintsFixedRootBackground : 1; | 457 unsigned m_backgroundLayerPaintsFixedRootBackground : 1; |
| 449 unsigned m_scrollingContentsAreEmpty : 1; | 458 unsigned m_scrollingContentsAreEmpty : 1; |
| 450 | 459 |
| 451 friend class CompositedLayerMappingTest; | 460 friend class CompositedLayerMappingTest; |
| 452 }; | 461 }; |
| 453 | 462 |
| 454 } // namespace blink | 463 } // namespace blink |
| 455 | 464 |
| 456 #endif // CompositedLayerMapping_h | 465 #endif // CompositedLayerMapping_h |
| OLD | NEW |