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

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

Issue 1739893006: Skip PaintLayer empty paint phases if it previously painted nothing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 9 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) 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 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 ClipRects* previousPaintingClipRects() const { return m_previousPaintingClip Rects.get(); } 662 ClipRects* previousPaintingClipRects() const { return m_previousPaintingClip Rects.get(); }
663 void setPreviousPaintingClipRects(ClipRects& clipRects) { m_previousPainting ClipRects = &clipRects; } 663 void setPreviousPaintingClipRects(ClipRects& clipRects) { m_previousPainting ClipRects = &clipRects; }
664 664
665 LayoutRect previousPaintDirtyRect() const { return m_previousPaintDirtyRect; } 665 LayoutRect previousPaintDirtyRect() const { return m_previousPaintDirtyRect; }
666 void setPreviousPaintDirtyRect(const LayoutRect& rect) { m_previousPaintDirt yRect = rect; } 666 void setPreviousPaintDirtyRect(const LayoutRect& rect) { m_previousPaintDirt yRect = rect; }
667 667
668 PaintLayerPainter::PaintResult previousPaintResult() const { return static_c ast<PaintLayerPainter::PaintResult>(m_previousPaintResult); } 668 PaintLayerPainter::PaintResult previousPaintResult() const { return static_c ast<PaintLayerPainter::PaintResult>(m_previousPaintResult); }
669 void setPreviousPaintResult(PaintLayerPainter::PaintResult result) { m_previ ousPaintResult = static_cast<unsigned>(result); ASSERT(m_previousPaintResult == static_cast<unsigned>(result)); } 669 void setPreviousPaintResult(PaintLayerPainter::PaintResult result) { m_previ ousPaintResult = static_cast<unsigned>(result); ASSERT(m_previousPaintResult == static_cast<unsigned>(result)); }
670 670
671 // Used to skip PaintPhaseDescendantOutlinesOnly for layers that have never had descendant outlines. 671 // Used to skip PaintPhaseDescendantOutlinesOnly for layers that have never had descendant outlines.
672 // Once it's set we never clear it because it's not easy to track if all out lines have been removed. 672 // The flag is set during paint invalidation on a self painting layer if any contained object has outline.
673 bool needsPaintPhaseDescendantOutlines() const { return m_needsPaintPhaseDes cendantOutlines; } 673 // It's cleared during painting if PaintPhaseDescendantOutlinesOnly painted nothing.
674 void setNeedsPaintPhaseDescendantOutlines() { ASSERT(isSelfPaintingLayer()); m_needsPaintPhaseDescendantOutlines = true; } 674 bool needsPaintPhaseDescendantOutlines() const { return m_needsPaintPhaseDes cendantOutlines && !m_previousPaintPhaseDescendantOutlinesWasEmpty; }
675 void setNeedsPaintPhaseDescendantOutlines()
676 {
677 ASSERT(isSelfPaintingLayer());
678 m_needsPaintPhaseDescendantOutlines = true;
679 m_previousPaintPhaseDescendantOutlinesWasEmpty = false;
680 }
681 void setPreviousPaintPhaseDescendantOutlinesEmpty(bool isEmpty) { m_previous PaintPhaseDescendantOutlinesWasEmpty = isEmpty; }
675 682
676 // Similar to above, but for PaintPhaseFloat. 683 // Similar to above, but for PaintPhaseFloat.
677 bool needsPaintPhaseFloat() const { return m_needsPaintPhaseFloat; } 684 bool needsPaintPhaseFloat() const { return m_needsPaintPhaseFloat && !m_prev iousPaintPhaseFloatWasEmpty; }
678 void setNeedsPaintPhaseFloat() { ASSERT(isSelfPaintingLayer()); m_needsPaint PhaseFloat = true; } 685 void setNeedsPaintPhaseFloat()
686 {
687 ASSERT(isSelfPaintingLayer());
688 m_needsPaintPhaseFloat = true;
689 m_previousPaintPhaseFloatWasEmpty = false;
690 }
691 void setPreviousPaintPhaseFloatEmpty(bool isEmpty) { m_previousPaintPhaseFlo atWasEmpty= isEmpty; }
679 692
680 bool needsPaintPhaseDescendantBlockBackgrounds() const { return m_needsPaint PhaseDescendantBlockBackgrounds; } 693 // Similar to above, but for PaintPhaseDescendantBlockBackgroundsOnly.
681 void setNeedsPaintPhaseDescendantBlockBackgrounds() { ASSERT(isSelfPaintingL ayer()); m_needsPaintPhaseDescendantBlockBackgrounds = true; } 694 bool needsPaintPhaseDescendantBlockBackgrounds() const { return m_needsPaint PhaseDescendantBlockBackgrounds && !m_previousPaintPhaseDescendantBlockBackgroun dsWasEmpty; }
695 void setNeedsPaintPhaseDescendantBlockBackgrounds()
696 {
697 ASSERT(isSelfPaintingLayer());
698 m_needsPaintPhaseDescendantBlockBackgrounds = true;
699 m_previousPaintPhaseDescendantBlockBackgroundsWasEmpty = false;
700 }
701 void setPreviousPaintPhaseDescendantBlockBackgroundsEmpty(bool isEmpty) { m_ previousPaintPhaseDescendantBlockBackgroundsWasEmpty = isEmpty; }
682 702
683 PaintTiming* paintTiming(); 703 PaintTiming* paintTiming();
684 704
685 ClipRectsCache* clipRectsCache() const { return m_clipRectsCache.get(); } 705 ClipRectsCache* clipRectsCache() const { return m_clipRectsCache.get(); }
686 ClipRectsCache& ensureClipRectsCache() const 706 ClipRectsCache& ensureClipRectsCache() const
687 { 707 {
688 if (!m_clipRectsCache) 708 if (!m_clipRectsCache)
689 m_clipRectsCache = adoptPtr(new ClipRectsCache); 709 m_clipRectsCache = adoptPtr(new ClipRectsCache);
690 return *m_clipRectsCache; 710 return *m_clipRectsCache;
691 } 711 }
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 unsigned m_shouldIsolateCompositedDescendants : 1; 840 unsigned m_shouldIsolateCompositedDescendants : 1;
821 841
822 // True if this layout layer just lost its grouped mapping due to the Compos itedLayerMapping being destroyed, 842 // True if this layout layer just lost its grouped mapping due to the Compos itedLayerMapping being destroyed,
823 // and we don't yet know to what graphics layer this Layer will be assigned. 843 // and we don't yet know to what graphics layer this Layer will be assigned.
824 unsigned m_lostGroupedMapping : 1; 844 unsigned m_lostGroupedMapping : 1;
825 845
826 unsigned m_needsRepaint : 1; 846 unsigned m_needsRepaint : 1;
827 unsigned m_previousPaintResult : 1; // PaintLayerPainter::PaintResult 847 unsigned m_previousPaintResult : 1; // PaintLayerPainter::PaintResult
828 848
829 unsigned m_needsPaintPhaseDescendantOutlines : 1; 849 unsigned m_needsPaintPhaseDescendantOutlines : 1;
850 unsigned m_previousPaintPhaseDescendantOutlinesWasEmpty : 1;
830 unsigned m_needsPaintPhaseFloat : 1; 851 unsigned m_needsPaintPhaseFloat : 1;
852 unsigned m_previousPaintPhaseFloatWasEmpty : 1;
831 unsigned m_needsPaintPhaseDescendantBlockBackgrounds : 1; 853 unsigned m_needsPaintPhaseDescendantBlockBackgrounds : 1;
854 unsigned m_previousPaintPhaseDescendantBlockBackgroundsWasEmpty : 1;
832 855
833 // These bitfields are part of ancestor/descendant dependent compositing inp uts. 856 // These bitfields are part of ancestor/descendant dependent compositing inp uts.
834 unsigned m_hasDescendantWithClipPath : 1; 857 unsigned m_hasDescendantWithClipPath : 1;
835 unsigned m_hasNonIsolatedDescendantWithBlendMode : 1; 858 unsigned m_hasNonIsolatedDescendantWithBlendMode : 1;
836 unsigned m_hasAncestorWithClipPath : 1; 859 unsigned m_hasAncestorWithClipPath : 1;
837 860
838 LayoutBoxModelObject* m_layoutObject; 861 LayoutBoxModelObject* m_layoutObject;
839 862
840 PaintLayer* m_parent; 863 PaintLayer* m_parent;
841 PaintLayer* m_previous; 864 PaintLayer* m_previous;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
874 897
875 } // namespace blink 898 } // namespace blink
876 899
877 #ifndef NDEBUG 900 #ifndef NDEBUG
878 // Outside the WebCore namespace for ease of invocation from gdb. 901 // Outside the WebCore namespace for ease of invocation from gdb.
879 void showLayerTree(const blink::PaintLayer*); 902 void showLayerTree(const blink::PaintLayer*);
880 void showLayerTree(const blink::LayoutObject*); 903 void showLayerTree(const blink::LayoutObject*);
881 #endif 904 #endif
882 905
883 #endif // Layer_h 906 #endif // Layer_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.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