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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayer.h

Issue 1490063002: Implement Paint Containment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix merge Created 5 years 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) 2003, 2009, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Intel Corporation. All rights reserved. 3 * Copyright (C) 2013 Intel Corporation. All rights reserved.
4 * 4 *
5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
6 * 6 *
7 * Other contributors: 7 * Other contributors:
8 * Robert O'Callahan <roc+@cs.cmu.edu> 8 * Robert O'Callahan <roc+@cs.cmu.edu>
9 * David Baron <dbaron@fas.harvard.edu> 9 * David Baron <dbaron@fas.harvard.edu>
10 * Christian Biesinger <cbiesinger@web.de> 10 * Christian Biesinger <cbiesinger@web.de>
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 bool hasBoxDecorationsOrBackground() const; 254 bool hasBoxDecorationsOrBackground() const;
255 bool hasVisibleBoxDecorations() const; 255 bool hasVisibleBoxDecorations() const;
256 // True if this layer container layoutObjects that paint. 256 // True if this layer container layoutObjects that paint.
257 bool hasNonEmptyChildLayoutObjects() const; 257 bool hasNonEmptyChildLayoutObjects() const;
258 258
259 // Will ensure that hasNonCompositiedChild are up to date. 259 // Will ensure that hasNonCompositiedChild are up to date.
260 void updateScrollingStateAfterCompositingChange(); 260 void updateScrollingStateAfterCompositingChange();
261 bool hasVisibleNonLayerContent() const { return m_hasVisibleNonLayerContent; } 261 bool hasVisibleNonLayerContent() const { return m_hasVisibleNonLayerContent; }
262 bool hasNonCompositedChild() const { ASSERT(isAllowedToQueryCompositingState ()); return m_hasNonCompositedChild; } 262 bool hasNonCompositedChild() const { ASSERT(isAllowedToQueryCompositingState ()); return m_hasNonCompositedChild; }
263 263
264 // Gets the ancestor layer that serves as the containing block of this layer . It is assumed 264 // Gets the ancestor layer that serves as the containing block of this layer . This is either
265 // that this layer is established by an out-of-flow positioned layout object (i.e. either 265 // another out of flow positioned layer, or one that contains paint.
266 // absolutely or fixed positioned).
267 // If |ancestor| is specified, |*skippedAncestor| will be set to true if |an cestor| is found in 266 // If |ancestor| is specified, |*skippedAncestor| will be set to true if |an cestor| is found in
268 // the ancestry chain between this layer and the containing block layer; if not found, it will 267 // the ancestry chain between this layer and the containing block layer; if not found, it will
269 // be set to false. Either both |ancestor| and |skippedAncestor| should be n ullptr, or none of 268 // be set to false. Either both |ancestor| and |skippedAncestor| should be n ullptr, or none of
270 // them should. 269 // them should.
271 PaintLayer* enclosingPositionedAncestor(const PaintLayer* ancestor = nullptr , bool* skippedAncestor = nullptr) const; 270 PaintLayer* containingLayerForOutOfFlowPositioned(const PaintLayer* ancestor = nullptr, bool* skippedAncestor = nullptr) const;
272 271
273 bool isPaintInvalidationContainer() const; 272 bool isPaintInvalidationContainer() const;
274 273
275 // Do *not* call this method unless you know what you are dooing. You probab ly want to call enclosingCompositingLayerForPaintInvalidation() instead. 274 // Do *not* call this method unless you know what you are dooing. You probab ly want to call enclosingCompositingLayerForPaintInvalidation() instead.
276 // If includeSelf is true, may return this. 275 // If includeSelf is true, may return this.
277 PaintLayer* enclosingLayerWithCompositedLayerMapping(IncludeSelfOrNot) const ; 276 PaintLayer* enclosingLayerWithCompositedLayerMapping(IncludeSelfOrNot) const ;
278 277
279 // Returns the enclosing layer root into which this layer paints, inclusive of this one. Note that the enclosing layer may or may not have its own 278 // Returns the enclosing layer root into which this layer paints, inclusive of this one. Note that the enclosing layer may or may not have its own
280 // GraphicsLayer backing, but is nevertheless the root for a call to the Lay er::paint*() methods. 279 // GraphicsLayer backing, but is nevertheless the root for a call to the Lay er::paint*() methods.
281 PaintLayer* enclosingLayerForPaintInvalidation() const; 280 PaintLayer* enclosingLayerForPaintInvalidation() const;
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 void addLayerHitTestRects(LayerHitTestRects&) const; 451 void addLayerHitTestRects(LayerHitTestRects&) const;
453 452
454 // Compute rects only for this layer 453 // Compute rects only for this layer
455 void computeSelfHitTestRects(LayerHitTestRects&) const; 454 void computeSelfHitTestRects(LayerHitTestRects&) const;
456 455
457 // FIXME: This should probably return a ScrollableArea but a lot of internal methods are mistakenly exposed. 456 // FIXME: This should probably return a ScrollableArea but a lot of internal methods are mistakenly exposed.
458 PaintLayerScrollableArea* scrollableArea() const { return m_scrollableArea.g et(); } 457 PaintLayerScrollableArea* scrollableArea() const { return m_scrollableArea.g et(); }
459 PaintLayerClipper& clipper() { return m_clipper; } 458 PaintLayerClipper& clipper() { return m_clipper; }
460 const PaintLayerClipper& clipper() const { return m_clipper; } 459 const PaintLayerClipper& clipper() const { return m_clipper; }
461 460
462 inline bool isPositionedContainer() const
463 {
464 // FIXME: This is not in sync with containingBlock.
465 // LayoutObject::canContainFixedPositionObjects() should probably be use d
466 // instead.
467 LayoutBoxModelObject* layerlayoutObject = layoutObject();
468 return isRootLayer() || layerlayoutObject->isPositioned() || hasTransfor mRelatedProperty();
469 }
470
471 bool scrollsOverflow() const; 461 bool scrollsOverflow() const;
472 462
473 CompositingReasons potentialCompositingReasonsFromStyle() const { return m_p otentialCompositingReasonsFromStyle; } 463 CompositingReasons potentialCompositingReasonsFromStyle() const { return m_p otentialCompositingReasonsFromStyle; }
474 void setPotentialCompositingReasonsFromStyle(CompositingReasons reasons) { A SSERT(reasons == (reasons & CompositingReasonComboAllStyleDeterminedReasons)); m _potentialCompositingReasonsFromStyle = reasons; } 464 void setPotentialCompositingReasonsFromStyle(CompositingReasons reasons) { A SSERT(reasons == (reasons & CompositingReasonComboAllStyleDeterminedReasons)); m _potentialCompositingReasonsFromStyle = reasons; }
475 465
476 bool hasStyleDeterminedDirectCompositingReasons() const { return m_potential CompositingReasonsFromStyle & CompositingReasonComboAllDirectStyleDeterminedReas ons; } 466 bool hasStyleDeterminedDirectCompositingReasons() const { return m_potential CompositingReasonsFromStyle & CompositingReasonComboAllDirectStyleDeterminedReas ons; }
477 467
478 class AncestorDependentCompositingInputs { 468 class AncestorDependentCompositingInputs {
479 DISALLOW_NEW(); 469 DISALLOW_NEW();
480 public: 470 public:
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
815 805
816 } // namespace blink 806 } // namespace blink
817 807
818 #ifndef NDEBUG 808 #ifndef NDEBUG
819 // Outside the WebCore namespace for ease of invocation from gdb. 809 // Outside the WebCore namespace for ease of invocation from gdb.
820 void showLayerTree(const blink::PaintLayer*); 810 void showLayerTree(const blink::PaintLayer*);
821 void showLayerTree(const blink::LayoutObject*); 811 void showLayerTree(const blink::LayoutObject*);
822 #endif 812 #endif
823 813
824 #endif // Layer_h 814 #endif // Layer_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/BoxClipper.cpp ('k') | third_party/WebKit/Source/core/paint/PaintLayer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698