Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.h

Issue 2019583002: Don't include scroll offset in offsetFromLayoutObject for scrolling contents layers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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);
137 // Invalidates just scrolling content layers.
138 void scrollingDisplayItemClientWasInvalidated(const DisplayItemClient&, Pain tInvalidationReason);
135 139
136 // Notification from the layoutObject that its content changed. 140 // Notification from the layoutObject that its content changed.
137 void contentChanged(ContentChangeType); 141 void contentChanged(ContentChangeType);
138 142
139 LayoutRect compositedBounds() const { return m_compositedBounds; } 143 LayoutRect compositedBounds() const { return m_compositedBounds; }
140 IntRect pixelSnappedCompositedBounds() const; 144 IntRect pixelSnappedCompositedBounds() const;
141 145
142 void positionOverflowControlsLayers(); 146 void positionOverflowControlsLayers();
143 147
144 // Returns true if the assignment actually changed the assigned squashing la yer. 148 // Returns true if the assignment actually changed the assigned squashing la yer.
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 LayoutPoint squashingOffsetFromTransformedAncestor() 213 LayoutPoint squashingOffsetFromTransformedAncestor()
210 { 214 {
211 return m_squashingLayerOffsetFromTransformedAncestor; 215 return m_squashingLayerOffsetFromTransformedAncestor;
212 } 216 }
213 217
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. 218 // 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); 219 const GraphicsLayerPaintInfo* containingSquashedLayer(const LayoutObject*, u nsigned maxSquashedLayerIndex);
216 220
217 void updateScrollingBlockSelection(); 221 void updateScrollingBlockSelection();
218 222
223 void adjustForCompositedScrolling(const GraphicsLayer*, IntSize& offset) con st;
224
219 private: 225 private:
220 IntRect recomputeInterestRect(const GraphicsLayer*) const; 226 IntRect recomputeInterestRect(const GraphicsLayer*) const;
221 static bool interestRectChangedEnoughToRepaint(const IntRect& previousIntere stRect, const IntRect& newInterestRect, const IntSize& layerSize); 227 static bool interestRectChangedEnoughToRepaint(const IntRect& previousIntere stRect, const IntRect& newInterestRect, const IntSize& layerSize);
222 228
223 static const GraphicsLayerPaintInfo* containingSquashedLayer(const LayoutObj ect*, const Vector<GraphicsLayerPaintInfo>& layers, unsigned maxSquashedLayerIn dex); 229 static const GraphicsLayerPaintInfo* containingSquashedLayer(const LayoutObj ect*, const Vector<GraphicsLayerPaintInfo>& layers, unsigned maxSquashedLayerIn dex);
224 230
225 // Paints the scrollbar part associated with the given graphics layer into t he given context. 231 // 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; 232 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. 233 // Returns whether the given layer is part of the scrollable area, if any, a ssociated with this mapping.
228 bool isScrollableAreaLayer(const GraphicsLayer*) const; 234 bool isScrollableAreaLayer(const GraphicsLayer*) const;
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 // Stacking children of a squashed layer receive graphics layers that are pa rented to the compositd ancestor of the 439 // 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). 440 // 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. 441 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. 442 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; 443 Vector<GraphicsLayerPaintInfo> m_squashedLayers;
438 LayoutPoint m_squashingLayerOffsetFromTransformedAncestor; 444 LayoutPoint m_squashingLayerOffsetFromTransformedAncestor;
439 445
440 LayoutRect m_compositedBounds; 446 LayoutRect m_compositedBounds;
441 447
442 LayoutSize m_contentOffsetInCompositingLayer; 448 LayoutSize m_contentOffsetInCompositingLayer;
449
450 // We keep track of the scrolling contents offset, so that when it changes w e can notify the ScrollingCoordinator, which
451 // passes on main-thread scrolling updates to the compositor.
452 DoubleSize m_scrollingContentsOffset;
453
443 unsigned m_contentOffsetInCompositingLayerDirty : 1; 454 unsigned m_contentOffsetInCompositingLayerDirty : 1;
444 455
445 unsigned m_pendingUpdateScope : 2; 456 unsigned m_pendingUpdateScope : 2;
446 unsigned m_isMainFrameLayoutViewLayer : 1; 457 unsigned m_isMainFrameLayoutViewLayer : 1;
447 458
448 unsigned m_backgroundLayerPaintsFixedRootBackground : 1; 459 unsigned m_backgroundLayerPaintsFixedRootBackground : 1;
449 unsigned m_scrollingContentsAreEmpty : 1; 460 unsigned m_scrollingContentsAreEmpty : 1;
450 461
451 friend class CompositedLayerMappingTest; 462 friend class CompositedLayerMappingTest;
452 }; 463 };
453 464
454 } // namespace blink 465 } // namespace blink
455 466
456 #endif // CompositedLayerMapping_h 467 #endif // CompositedLayerMapping_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698