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

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

Issue 2285633005: Reland of Skip PaintLayer empty paint phases if it previously painted nothing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: - Created 4 years, 3 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 663 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 ClipRects* previousPaintingClipRects() const { return m_previousPaintingClip Rects.get(); } 674 ClipRects* previousPaintingClipRects() const { return m_previousPaintingClip Rects.get(); }
675 void setPreviousPaintingClipRects(ClipRects& clipRects) { m_previousPainting ClipRects = &clipRects; } 675 void setPreviousPaintingClipRects(ClipRects& clipRects) { m_previousPainting ClipRects = &clipRects; }
676 676
677 LayoutRect previousPaintDirtyRect() const { return m_previousPaintDirtyRect; } 677 LayoutRect previousPaintDirtyRect() const { return m_previousPaintDirtyRect; }
678 void setPreviousPaintDirtyRect(const LayoutRect& rect) { m_previousPaintDirt yRect = rect; } 678 void setPreviousPaintDirtyRect(const LayoutRect& rect) { m_previousPaintDirt yRect = rect; }
679 679
680 PaintLayerPainter::PaintResult previousPaintResult() const { return static_c ast<PaintLayerPainter::PaintResult>(m_previousPaintResult); } 680 PaintLayerPainter::PaintResult previousPaintResult() const { return static_c ast<PaintLayerPainter::PaintResult>(m_previousPaintResult); }
681 void setPreviousPaintResult(PaintLayerPainter::PaintResult result) { m_previ ousPaintResult = static_cast<unsigned>(result); ASSERT(m_previousPaintResult == static_cast<unsigned>(result)); } 681 void setPreviousPaintResult(PaintLayerPainter::PaintResult result) { m_previ ousPaintResult = static_cast<unsigned>(result); ASSERT(m_previousPaintResult == static_cast<unsigned>(result)); }
682 682
683 // Used to skip PaintPhaseDescendantOutlinesOnly for layers that have never had descendant outlines. 683 // Used to skip PaintPhaseDescendantOutlinesOnly for layers that have never had descendant outlines.
684 // Once it's set we never clear it because it's not easy to track if all out lines have been removed. 684 // The flag is set during paint invalidation on a self painting layer if any contained object has outline.
685 // It's cleared during painting if PaintPhaseDescendantOutlinesOnly painted nothing.
685 // For more details, see core/paint/REAME.md#Empty paint phase optimization. 686 // For more details, see core/paint/REAME.md#Empty paint phase optimization.
686 bool needsPaintPhaseDescendantOutlines() const { return m_needsPaintPhaseDes cendantOutlines; } 687 bool needsPaintPhaseDescendantOutlines() const { return m_needsPaintPhaseDes cendantOutlines && !m_previousPaintPhaseDescendantOutlinesWasEmpty; }
687 void setNeedsPaintPhaseDescendantOutlines() { ASSERT(isSelfPaintingLayer()); m_needsPaintPhaseDescendantOutlines = true; } 688 void setNeedsPaintPhaseDescendantOutlines()
689 {
690 DCHECK(isSelfPaintingLayer());
691 m_needsPaintPhaseDescendantOutlines = true;
692 m_previousPaintPhaseDescendantOutlinesWasEmpty = false;
693 }
694 void setPreviousPaintPhaseDescendantOutlinesEmpty(bool isEmpty) { m_previous PaintPhaseDescendantOutlinesWasEmpty = isEmpty; }
688 695
689 // Similar to above, but for PaintPhaseFloat. 696 // Similar to above, but for PaintPhaseFloat.
690 bool needsPaintPhaseFloat() const { return m_needsPaintPhaseFloat; } 697 bool needsPaintPhaseFloat() const { return m_needsPaintPhaseFloat && !m_prev iousPaintPhaseFloatWasEmpty; }
691 void setNeedsPaintPhaseFloat() { ASSERT(isSelfPaintingLayer()); m_needsPaint PhaseFloat = true; } 698 void setNeedsPaintPhaseFloat()
699 {
700 DCHECK(isSelfPaintingLayer());
701 m_needsPaintPhaseFloat = true;
702 m_previousPaintPhaseFloatWasEmpty = false;
703 }
704 void setPreviousPaintPhaseFloatEmpty(bool isEmpty) { m_previousPaintPhaseFlo atWasEmpty= isEmpty; }
692 705
693 bool needsPaintPhaseDescendantBlockBackgrounds() const { return m_needsPaint PhaseDescendantBlockBackgrounds; } 706 // Similar to above, but for PaintPhaseDescendantBlockBackgroundsOnly.
694 void setNeedsPaintPhaseDescendantBlockBackgrounds() { ASSERT(isSelfPaintingL ayer()); m_needsPaintPhaseDescendantBlockBackgrounds = true; } 707 bool needsPaintPhaseDescendantBlockBackgrounds() const { return m_needsPaint PhaseDescendantBlockBackgrounds && !m_previousPaintPhaseDescendantBlockBackgroun dsWasEmpty; }
708 void setNeedsPaintPhaseDescendantBlockBackgrounds()
709 {
710 DCHECK(isSelfPaintingLayer());
711 m_needsPaintPhaseDescendantBlockBackgrounds = true;
712 m_previousPaintPhaseDescendantBlockBackgroundsWasEmpty = false;
713 }
714 void setPreviousPaintPhaseDescendantBlockBackgroundsEmpty(bool isEmpty) { m_ previousPaintPhaseDescendantBlockBackgroundsWasEmpty = isEmpty; }
695 715
696 PaintTiming* paintTiming(); 716 PaintTiming* paintTiming();
697 717
698 ClipRectsCache* clipRectsCache() const { return m_clipRectsCache.get(); } 718 ClipRectsCache* clipRectsCache() const { return m_clipRectsCache.get(); }
699 ClipRectsCache& ensureClipRectsCache() const 719 ClipRectsCache& ensureClipRectsCache() const
700 { 720 {
701 if (!m_clipRectsCache) 721 if (!m_clipRectsCache)
702 m_clipRectsCache = wrapUnique(new ClipRectsCache); 722 m_clipRectsCache = wrapUnique(new ClipRectsCache);
703 return *m_clipRectsCache; 723 return *m_clipRectsCache;
704 } 724 }
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
844 unsigned m_shouldIsolateCompositedDescendants : 1; 864 unsigned m_shouldIsolateCompositedDescendants : 1;
845 865
846 // True if this layout layer just lost its grouped mapping due to the Compos itedLayerMapping being destroyed, 866 // True if this layout layer just lost its grouped mapping due to the Compos itedLayerMapping being destroyed,
847 // and we don't yet know to what graphics layer this Layer will be assigned. 867 // and we don't yet know to what graphics layer this Layer will be assigned.
848 unsigned m_lostGroupedMapping : 1; 868 unsigned m_lostGroupedMapping : 1;
849 869
850 unsigned m_needsRepaint : 1; 870 unsigned m_needsRepaint : 1;
851 unsigned m_previousPaintResult : 1; // PaintLayerPainter::PaintResult 871 unsigned m_previousPaintResult : 1; // PaintLayerPainter::PaintResult
852 872
853 unsigned m_needsPaintPhaseDescendantOutlines : 1; 873 unsigned m_needsPaintPhaseDescendantOutlines : 1;
874 unsigned m_previousPaintPhaseDescendantOutlinesWasEmpty : 1;
854 unsigned m_needsPaintPhaseFloat : 1; 875 unsigned m_needsPaintPhaseFloat : 1;
876 unsigned m_previousPaintPhaseFloatWasEmpty : 1;
855 unsigned m_needsPaintPhaseDescendantBlockBackgrounds : 1; 877 unsigned m_needsPaintPhaseDescendantBlockBackgrounds : 1;
878 unsigned m_previousPaintPhaseDescendantBlockBackgroundsWasEmpty : 1;
856 879
857 // These bitfields are part of ancestor/descendant dependent compositing inp uts. 880 // These bitfields are part of ancestor/descendant dependent compositing inp uts.
858 unsigned m_hasDescendantWithClipPath : 1; 881 unsigned m_hasDescendantWithClipPath : 1;
859 unsigned m_hasNonIsolatedDescendantWithBlendMode : 1; 882 unsigned m_hasNonIsolatedDescendantWithBlendMode : 1;
860 unsigned m_hasAncestorWithClipPath : 1; 883 unsigned m_hasAncestorWithClipPath : 1;
861 884
862 LayoutBoxModelObject* m_layoutObject; 885 LayoutBoxModelObject* m_layoutObject;
863 886
864 PaintLayer* m_parent; 887 PaintLayer* m_parent;
865 PaintLayer* m_previous; 888 PaintLayer* m_previous;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
901 924
902 } // namespace blink 925 } // namespace blink
903 926
904 #ifndef NDEBUG 927 #ifndef NDEBUG
905 // Outside the WebCore namespace for ease of invocation from gdb. 928 // Outside the WebCore namespace for ease of invocation from gdb.
906 void showLayerTree(const blink::PaintLayer*); 929 void showLayerTree(const blink::PaintLayer*);
907 void showLayerTree(const blink::LayoutObject*); 930 void showLayerTree(const blink::LayoutObject*);
908 #endif 931 #endif
909 932
910 #endif // Layer_h 933 #endif // Layer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698