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

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

Issue 1640843003: Make PaintLayerClipper objects transient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@PaintLayerRareData
Patch Set: Inline PaintLayerClipper ctor Created 4 years, 10 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 | « no previous file | third_party/WebKit/Source/core/paint/PaintLayer.cpp » ('j') | 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) 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 28 matching lines...) Expand all
39 * deletingthe provisions above and replace them with the notice and 39 * deletingthe provisions above and replace them with the notice and
40 * other provisions required by the MPL or the GPL, as the case may be. 40 * other provisions required by the MPL or the GPL, as the case may be.
41 * If you do not delete the provisions above, a recipient may use your 41 * If you do not delete the provisions above, a recipient may use your
42 * version of this file under any of the LGPL, the MPL or the GPL. 42 * version of this file under any of the LGPL, the MPL or the GPL.
43 */ 43 */
44 44
45 #ifndef PaintLayer_h 45 #ifndef PaintLayer_h
46 #define PaintLayer_h 46 #define PaintLayer_h
47 47
48 #include "core/CoreExport.h" 48 #include "core/CoreExport.h"
49 #include "core/layout/ClipRectsCache.h"
49 #include "core/layout/LayoutBox.h" 50 #include "core/layout/LayoutBox.h"
50 #include "core/paint/PaintLayerClipper.h" 51 #include "core/paint/PaintLayerClipper.h"
51 #include "core/paint/PaintLayerFilterInfo.h" 52 #include "core/paint/PaintLayerFilterInfo.h"
52 #include "core/paint/PaintLayerFragment.h" 53 #include "core/paint/PaintLayerFragment.h"
53 #include "core/paint/PaintLayerPainter.h" 54 #include "core/paint/PaintLayerPainter.h"
54 #include "core/paint/PaintLayerReflectionInfo.h" 55 #include "core/paint/PaintLayerReflectionInfo.h"
55 #include "core/paint/PaintLayerScrollableArea.h" 56 #include "core/paint/PaintLayerScrollableArea.h"
56 #include "core/paint/PaintLayerStackingNode.h" 57 #include "core/paint/PaintLayerStackingNode.h"
57 #include "core/paint/PaintLayerStackingNodeIterator.h" 58 #include "core/paint/PaintLayerStackingNodeIterator.h"
58 #include "platform/graphics/CompositingReasons.h" 59 #include "platform/graphics/CompositingReasons.h"
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 bool scrollsWithViewport() const; 491 bool scrollsWithViewport() const;
491 bool scrollsWithRespectTo(const PaintLayer*) const; 492 bool scrollsWithRespectTo(const PaintLayer*) const;
492 493
493 void addLayerHitTestRects(LayerHitTestRects&) const; 494 void addLayerHitTestRects(LayerHitTestRects&) const;
494 495
495 // Compute rects only for this layer 496 // Compute rects only for this layer
496 void computeSelfHitTestRects(LayerHitTestRects&) const; 497 void computeSelfHitTestRects(LayerHitTestRects&) const;
497 498
498 // FIXME: This should probably return a ScrollableArea but a lot of internal methods are mistakenly exposed. 499 // FIXME: This should probably return a ScrollableArea but a lot of internal methods are mistakenly exposed.
499 PaintLayerScrollableArea* scrollableArea() const { return m_scrollableArea.g et(); } 500 PaintLayerScrollableArea* scrollableArea() const { return m_scrollableArea.g et(); }
500 PaintLayerClipper& clipper() { return m_clipper; } 501
501 const PaintLayerClipper& clipper() const { return m_clipper; } 502 PaintLayerClipper clipper() const { return PaintLayerClipper(*this); }
502 503
503 bool scrollsOverflow() const; 504 bool scrollsOverflow() const;
504 505
505 CompositingReasons potentialCompositingReasonsFromStyle() const { return m_r areData ? m_rareData->potentialCompositingReasonsFromStyle : CompositingReasonNo ne; } 506 CompositingReasons potentialCompositingReasonsFromStyle() const { return m_r areData ? m_rareData->potentialCompositingReasonsFromStyle : CompositingReasonNo ne; }
506 void setPotentialCompositingReasonsFromStyle(CompositingReasons reasons) 507 void setPotentialCompositingReasonsFromStyle(CompositingReasons reasons)
507 { 508 {
508 ASSERT(reasons == (reasons & CompositingReasonComboAllStyleDeterminedRea sons)); 509 ASSERT(reasons == (reasons & CompositingReasonComboAllStyleDeterminedRea sons));
509 if (m_rareData || reasons != CompositingReasonNone) 510 if (m_rareData || reasons != CompositingReasonNone)
510 ensureRareData().potentialCompositingReasonsFromStyle = reasons; 511 ensureRareData().potentialCompositingReasonsFromStyle = reasons;
511 } 512 }
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 void clearNeedsRepaintRecursively(); 644 void clearNeedsRepaintRecursively();
644 645
645 // These previousXXX() functions are for subsequence caching. They save the painting status of the layer 646 // These previousXXX() functions are for subsequence caching. They save the painting status of the layer
646 // during the previous painting with subsequence. A painting without subsequ ence [1] doesn't change this status. 647 // during the previous painting with subsequence. A painting without subsequ ence [1] doesn't change this status.
647 // [1] See shouldCreateSubsequence() in PaintLayerPainter.cpp for the cases we use subsequence when painting a PaintLayer. 648 // [1] See shouldCreateSubsequence() in PaintLayerPainter.cpp for the cases we use subsequence when painting a PaintLayer.
648 649
649 IntSize previousScrollOffsetAccumulationForPainting() const { return m_previ ousScrollOffsetAccumulationForPainting; } 650 IntSize previousScrollOffsetAccumulationForPainting() const { return m_previ ousScrollOffsetAccumulationForPainting; }
650 void setPreviousScrollOffsetAccumulationForPainting(const IntSize& s) { m_pr eviousScrollOffsetAccumulationForPainting = s; } 651 void setPreviousScrollOffsetAccumulationForPainting(const IntSize& s) { m_pr eviousScrollOffsetAccumulationForPainting = s; }
651 652
652 ClipRects* previousPaintingClipRects() const { return m_previousPaintingClip Rects.get(); } 653 ClipRects* previousPaintingClipRects() const { return m_previousPaintingClip Rects.get(); }
653 void setPreviousPaintingClipRects(ClipRects* clipRects) { m_previousPainting ClipRects = clipRects; } 654 void setPreviousPaintingClipRects(ClipRects& clipRects) { m_previousPainting ClipRects = &clipRects; }
654 655
655 LayoutRect previousPaintDirtyRect() const { return m_previousPaintDirtyRect; } 656 LayoutRect previousPaintDirtyRect() const { return m_previousPaintDirtyRect; }
656 void setPreviousPaintDirtyRect(const LayoutRect& rect) { m_previousPaintDirt yRect = rect; } 657 void setPreviousPaintDirtyRect(const LayoutRect& rect) { m_previousPaintDirt yRect = rect; }
657 658
658 PaintLayerPainter::PaintResult previousPaintResult() const { return static_c ast<PaintLayerPainter::PaintResult>(m_previousPaintResult); } 659 PaintLayerPainter::PaintResult previousPaintResult() const { return static_c ast<PaintLayerPainter::PaintResult>(m_previousPaintResult); }
659 void setPreviousPaintResult(PaintLayerPainter::PaintResult result) { m_previ ousPaintResult = static_cast<unsigned>(result); ASSERT(m_previousPaintResult == static_cast<unsigned>(result)); } 660 void setPreviousPaintResult(PaintLayerPainter::PaintResult result) { m_previ ousPaintResult = static_cast<unsigned>(result); ASSERT(m_previousPaintResult == static_cast<unsigned>(result)); }
660 661
661 // Used to skip PaintPhaseDescendantOutlinesOnly for layers that have never had descendant outlines. 662 // Used to skip PaintPhaseDescendantOutlinesOnly for layers that have never had descendant outlines.
662 // Once it's set we never clear it because it's not easy to track if all out lines have been removed. 663 // Once it's set we never clear it because it's not easy to track if all out lines have been removed.
663 bool needsPaintPhaseDescendantOutlines() const { return m_needsPaintPhaseDes cendantOutlines; } 664 bool needsPaintPhaseDescendantOutlines() const { return m_needsPaintPhaseDes cendantOutlines; }
664 void setNeedsPaintPhaseDescendantOutlines() { ASSERT(isSelfPaintingLayer()); m_needsPaintPhaseDescendantOutlines = true; } 665 void setNeedsPaintPhaseDescendantOutlines() { ASSERT(isSelfPaintingLayer()); m_needsPaintPhaseDescendantOutlines = true; }
665 666
666 PaintTiming* paintTiming(); 667 PaintTiming* paintTiming();
667 668
669 ClipRectsCache* clipRectsCache() const { return m_clipRectsCache.get(); }
670 ClipRectsCache& ensureClipRectsCache() const
671 {
672 if (!m_clipRectsCache)
673 m_clipRectsCache = adoptPtr(new ClipRectsCache);
674 return *m_clipRectsCache;
675 }
676 void clearClipRectsCache() const { m_clipRectsCache.clear(); }
677
668 private: 678 private:
669 // Bounding box in the coordinates of this layer. 679 // Bounding box in the coordinates of this layer.
670 LayoutRect logicalBoundingBox() const; 680 LayoutRect logicalBoundingBox() const;
671 681
672 bool hasOverflowControls() const; 682 bool hasOverflowControls() const;
673 683
674 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); 684 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus();
675 685
676 // Returns true if the position changed. 686 // Returns true if the position changed.
677 bool updateLayerPosition(); 687 bool updateLayerPosition();
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 838
829 // Cached normal flow values for absolute positioned elements with static le ft/top values. 839 // Cached normal flow values for absolute positioned elements with static le ft/top values.
830 LayoutUnit m_staticInlinePosition; 840 LayoutUnit m_staticInlinePosition;
831 LayoutUnit m_staticBlockPosition; 841 LayoutUnit m_staticBlockPosition;
832 842
833 AncestorDependentCompositingInputs m_ancestorDependentCompositingInputs; 843 AncestorDependentCompositingInputs m_ancestorDependentCompositingInputs;
834 OwnPtr<RareAncestorDependentCompositingInputs> m_rareAncestorDependentCompos itingInputs; 844 OwnPtr<RareAncestorDependentCompositingInputs> m_rareAncestorDependentCompos itingInputs;
835 845
836 OwnPtrWillBePersistent<PaintLayerScrollableArea> m_scrollableArea; 846 OwnPtrWillBePersistent<PaintLayerScrollableArea> m_scrollableArea;
837 847
838 PaintLayerClipper m_clipper; // FIXME: Lazily allocate? 848 mutable OwnPtr<ClipRectsCache> m_clipRectsCache;
849
839 OwnPtr<PaintLayerStackingNode> m_stackingNode; 850 OwnPtr<PaintLayerStackingNode> m_stackingNode;
840 851
841 IntSize m_previousScrollOffsetAccumulationForPainting; 852 IntSize m_previousScrollOffsetAccumulationForPainting;
842 RefPtr<ClipRects> m_previousPaintingClipRects; 853 RefPtr<ClipRects> m_previousPaintingClipRects;
843 LayoutRect m_previousPaintDirtyRect; 854 LayoutRect m_previousPaintDirtyRect;
844 855
845 OwnPtr<PaintLayerRareData> m_rareData; 856 OwnPtr<PaintLayerRareData> m_rareData;
846 }; 857 };
847 858
848 } // namespace blink 859 } // namespace blink
849 860
850 #ifndef NDEBUG 861 #ifndef NDEBUG
851 // Outside the WebCore namespace for ease of invocation from gdb. 862 // Outside the WebCore namespace for ease of invocation from gdb.
852 void showLayerTree(const blink::PaintLayer*); 863 void showLayerTree(const blink::PaintLayer*);
853 void showLayerTree(const blink::LayoutObject*); 864 void showLayerTree(const blink::LayoutObject*);
854 #endif 865 #endif
855 866
856 #endif // Layer_h 867 #endif // Layer_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/PaintLayer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698