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

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)
682 {
683 ASSERT(isSelfPaintingLayer());
684 m_previousPaintPhaseDescendantOutlinesWasEmpty = isEmpty;
685 }
675 686
676 // Similar to above, but for PaintPhaseFloat. 687 // Similar to above, but for PaintPhaseFloat.
677 bool needsPaintPhaseFloat() const { return m_needsPaintPhaseFloat; } 688 bool needsPaintPhaseFloat() const { return m_needsPaintPhaseFloat && !m_prev iousPaintPhaseFloatWasEmpty; }
678 void setNeedsPaintPhaseFloat() { ASSERT(isSelfPaintingLayer()); m_needsPaint PhaseFloat = true; } 689 void setNeedsPaintPhaseFloat()
690 {
691 ASSERT(isSelfPaintingLayer());
692 m_needsPaintPhaseFloat = true;
693 m_previousPaintPhaseFloatWasEmpty = false;
694 }
695 void setPreviousPaintPhaseFloatEmpty(bool isEmpty)
696 {
697 ASSERT(isSelfPaintingLayer());
698 m_previousPaintPhaseFloatWasEmpty= isEmpty;
699 }
679 700
680 bool needsPaintPhaseDescendantBlockBackgrounds() const { return m_needsPaint PhaseDescendantBlockBackgrounds; } 701 // Similar to above, but for PaintPhaseDescendantBlockBackgroundsOnly.
681 void setNeedsPaintPhaseDescendantBlockBackgrounds() { ASSERT(isSelfPaintingL ayer()); m_needsPaintPhaseDescendantBlockBackgrounds = true; } 702 bool needsPaintPhaseDescendantBlockBackgrounds() const { return m_needsPaint PhaseDescendantBlockBackgrounds && !m_previousPaintPhaseDescendantBlockBackgroun dsWasEmpty; }
703 void setNeedsPaintPhaseDescendantBlockBackgrounds()
704 {
705 ASSERT(isSelfPaintingLayer());
706 m_needsPaintPhaseDescendantBlockBackgrounds = true;
707 m_previousPaintPhaseDescendantBlockBackgroundsWasEmpty = false;
708 }
709 void setPreviousPaintPhaseDescendantBlockBackgroundsEmpty(bool isEmpty)
710 {
711 ASSERT(isSelfPaintingLayer());
712 m_previousPaintPhaseDescendantBlockBackgroundsWasEmpty = isEmpty;
713 }
682 714
683 PaintTiming* paintTiming(); 715 PaintTiming* paintTiming();
684 716
685 ClipRectsCache* clipRectsCache() const { return m_clipRectsCache.get(); } 717 ClipRectsCache* clipRectsCache() const { return m_clipRectsCache.get(); }
686 ClipRectsCache& ensureClipRectsCache() const 718 ClipRectsCache& ensureClipRectsCache() const
687 { 719 {
688 if (!m_clipRectsCache) 720 if (!m_clipRectsCache)
689 m_clipRectsCache = adoptPtr(new ClipRectsCache); 721 m_clipRectsCache = adoptPtr(new ClipRectsCache);
690 return *m_clipRectsCache; 722 return *m_clipRectsCache;
691 } 723 }
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 unsigned m_shouldIsolateCompositedDescendants : 1; 852 unsigned m_shouldIsolateCompositedDescendants : 1;
821 853
822 // True if this layout layer just lost its grouped mapping due to the Compos itedLayerMapping being destroyed, 854 // 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. 855 // and we don't yet know to what graphics layer this Layer will be assigned.
824 unsigned m_lostGroupedMapping : 1; 856 unsigned m_lostGroupedMapping : 1;
825 857
826 unsigned m_needsRepaint : 1; 858 unsigned m_needsRepaint : 1;
827 unsigned m_previousPaintResult : 1; // PaintLayerPainter::PaintResult 859 unsigned m_previousPaintResult : 1; // PaintLayerPainter::PaintResult
828 860
829 unsigned m_needsPaintPhaseDescendantOutlines : 1; 861 unsigned m_needsPaintPhaseDescendantOutlines : 1;
862 unsigned m_previousPaintPhaseDescendantOutlinesWasEmpty : 1;
830 unsigned m_needsPaintPhaseFloat : 1; 863 unsigned m_needsPaintPhaseFloat : 1;
864 unsigned m_previousPaintPhaseFloatWasEmpty : 1;
831 unsigned m_needsPaintPhaseDescendantBlockBackgrounds : 1; 865 unsigned m_needsPaintPhaseDescendantBlockBackgrounds : 1;
866 unsigned m_previousPaintPhaseDescendantBlockBackgroundsWasEmpty : 1;
832 867
833 // These bitfields are part of ancestor/descendant dependent compositing inp uts. 868 // These bitfields are part of ancestor/descendant dependent compositing inp uts.
834 unsigned m_hasDescendantWithClipPath : 1; 869 unsigned m_hasDescendantWithClipPath : 1;
835 unsigned m_hasNonIsolatedDescendantWithBlendMode : 1; 870 unsigned m_hasNonIsolatedDescendantWithBlendMode : 1;
836 unsigned m_hasAncestorWithClipPath : 1; 871 unsigned m_hasAncestorWithClipPath : 1;
837 872
838 LayoutBoxModelObject* m_layoutObject; 873 LayoutBoxModelObject* m_layoutObject;
839 874
840 PaintLayer* m_parent; 875 PaintLayer* m_parent;
841 PaintLayer* m_previous; 876 PaintLayer* m_previous;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
874 909
875 } // namespace blink 910 } // namespace blink
876 911
877 #ifndef NDEBUG 912 #ifndef NDEBUG
878 // Outside the WebCore namespace for ease of invocation from gdb. 913 // Outside the WebCore namespace for ease of invocation from gdb.
879 void showLayerTree(const blink::PaintLayer*); 914 void showLayerTree(const blink::PaintLayer*);
880 void showLayerTree(const blink::LayoutObject*); 915 void showLayerTree(const blink::LayoutObject*);
881 #endif 916 #endif
882 917
883 #endif // Layer_h 918 #endif // Layer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698