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

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

Issue 2235873002: Invalidate scrolling contents layer on background invalidations painted into it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Invalidate entire scrolling contents layer. Created 4 years, 4 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 return m_squashingLayerOffsetFromTransformedAncestor; 212 return m_squashingLayerOffsetFromTransformedAncestor;
213 } 213 }
214 214
215 // 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 // 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 const GraphicsLayerPaintInfo* containingSquashedLayer(const LayoutObject*, u nsigned maxSquashedLayerIndex); 216 const GraphicsLayerPaintInfo* containingSquashedLayer(const LayoutObject*, u nsigned maxSquashedLayerIndex);
217 217
218 void updateScrollingBlockSelection(); 218 void updateScrollingBlockSelection();
219 219
220 void adjustForCompositedScrolling(const GraphicsLayer*, IntSize& offset) con st; 220 void adjustForCompositedScrolling(const GraphicsLayer*, IntSize& offset) con st;
221 221
222 // Returns true for layers with scrollable overflow which have a background
223 // that can be painted into the composited scrolling contents layer (i.e.
224 // the background can scroll with the content). When the background is also
225 // opaque this allows us to composite the scroller even on low DPI as we can
226 // draw with subpixel anti-aliasing.
227 bool shouldPaintBackgroundOntoScrollingContentsLayer() const;
228
222 private: 229 private:
223 IntRect recomputeInterestRect(const GraphicsLayer*) const; 230 IntRect recomputeInterestRect(const GraphicsLayer*) const;
224 static bool interestRectChangedEnoughToRepaint(const IntRect& previousIntere stRect, const IntRect& newInterestRect, const IntSize& layerSize); 231 static bool interestRectChangedEnoughToRepaint(const IntRect& previousIntere stRect, const IntRect& newInterestRect, const IntSize& layerSize);
225 232
226 static const GraphicsLayerPaintInfo* containingSquashedLayer(const LayoutObj ect*, const Vector<GraphicsLayerPaintInfo>& layers, unsigned maxSquashedLayerIn dex); 233 static const GraphicsLayerPaintInfo* containingSquashedLayer(const LayoutObj ect*, const Vector<GraphicsLayerPaintInfo>& layers, unsigned maxSquashedLayerIn dex);
227 234
228 // Paints the scrollbar part associated with the given graphics layer into t he given context. 235 // Paints the scrollbar part associated with the given graphics layer into t he given context.
229 void paintScrollableArea(const GraphicsLayer*, GraphicsContext&, const IntRe ct& interestRect) const; 236 void paintScrollableArea(const GraphicsLayer*, GraphicsContext&, const IntRe ct& interestRect) const;
230 // Returns whether the given layer is part of the scrollable area, if any, a ssociated with this mapping. 237 // Returns whether the given layer is part of the scrollable area, if any, a ssociated with this mapping.
231 bool isScrollableAreaLayer(const GraphicsLayer*) const; 238 bool isScrollableAreaLayer(const GraphicsLayer*) const;
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 // Return true if |m_owningLayer|'s compositing ancestor is not a descendant (inclusive) of the 329 // Return true if |m_owningLayer|'s compositing ancestor is not a descendant (inclusive) of the
323 // clipping container for |m_owningLayer|. 330 // clipping container for |m_owningLayer|.
324 bool owningLayerClippedByLayerNotAboveCompositedAncestor(const PaintLayer* s crollParent); 331 bool owningLayerClippedByLayerNotAboveCompositedAncestor(const PaintLayer* s crollParent);
325 332
326 const PaintLayer* scrollParent(); 333 const PaintLayer* scrollParent();
327 334
328 // Clear the groupedMapping entry on the layer at the given index, only if t hat layer does 335 // Clear the groupedMapping entry on the layer at the given index, only if t hat layer does
329 // not appear earlier in the set of layers for this object. 336 // not appear earlier in the set of layers for this object.
330 bool invalidateLayerIfNoPrecedingEntry(size_t); 337 bool invalidateLayerIfNoPrecedingEntry(size_t);
331 338
332 // Returns true for layers with scrollable overflow which have a background
333 // that can be painted into the composited scrolling contents layer (i.e.
334 // the background can scroll with the content). When the background is also
335 // opaque this allows us to composite the scroller even on low DPI as we can
336 // draw with subpixel anti-aliasing.
337 bool shouldPaintBackgroundOntoScrollingContentsLayer() const;
338
339 PaintLayer& m_owningLayer; 339 PaintLayer& m_owningLayer;
340 340
341 // The hierarchy of layers that is maintained by the CompositedLayerMapping looks like this: 341 // The hierarchy of layers that is maintained by the CompositedLayerMapping looks like this:
342 // 342 //
343 // + m_ancestorClippingLayer [OPTIONAL] 343 // + m_ancestorClippingLayer [OPTIONAL]
344 // + m_graphicsLayer 344 // + m_graphicsLayer
345 // + m_childTransformLayer [OPTIONAL] 345 // + m_childTransformLayer [OPTIONAL]
346 // | + m_childContainmentLayer [OPTIONAL] <-OR-> m_scrollingLayer [OPTI ONAL] 346 // | + m_childContainmentLayer [OPTIONAL] <-OR-> m_scrollingLayer [OPTI ONAL]
347 // | + m_scrollingContentsL ayer [Present iff m_scrollingLayer is present] 347 // | + m_scrollingContentsL ayer [Present iff m_scrollingLayer is present]
348 // + m_overflowControlsAncestorClippingLayer [OPTIONAL] // *The overflo w controls may need to be repositioned in the 348 // + m_overflowControlsAncestorClippingLayer [OPTIONAL] // *The overflo w controls may need to be repositioned in the
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 462
463 unsigned m_backgroundLayerPaintsFixedRootBackground : 1; 463 unsigned m_backgroundLayerPaintsFixedRootBackground : 1;
464 unsigned m_scrollingContentsAreEmpty : 1; 464 unsigned m_scrollingContentsAreEmpty : 1;
465 465
466 friend class CompositedLayerMappingTest; 466 friend class CompositedLayerMappingTest;
467 }; 467 };
468 468
469 } // namespace blink 469 } // namespace blink
470 470
471 #endif // CompositedLayerMapping_h 471 #endif // CompositedLayerMapping_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698