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

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

Issue 2784963002: Optimize the pre-paint tree walk and ClipRects (Closed)
Patch Set: none Created 3 years, 8 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) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
3 * reserved. 3 * 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 88
89 namespace blink { 89 namespace blink {
90 90
91 namespace { 91 namespace {
92 92
93 static CompositingQueryMode gCompositingQueryMode = 93 static CompositingQueryMode gCompositingQueryMode =
94 CompositingQueriesAreOnlyAllowedInCertainDocumentLifecyclePhases; 94 CompositingQueriesAreOnlyAllowedInCertainDocumentLifecyclePhases;
95 95
96 struct SameSizeAsPaintLayer : DisplayItemClient { 96 struct SameSizeAsPaintLayer : DisplayItemClient {
97 int bitFields; 97 int bitFields;
98 void* pointers[11]; 98 void* pointers[10];
99 LayoutUnit layoutUnits[4]; 99 LayoutUnit layoutUnits[4];
100 IntSize size; 100 IntSize size;
101 Persistent<PaintLayerScrollableArea> scrollableArea; 101 Persistent<PaintLayerScrollableArea> scrollableArea;
102 struct { 102 struct {
103 IntSize size; 103 IntSize size;
104 void* pointer; 104 void* pointer;
105 LayoutRect rect; 105 LayoutRect rect;
106 } previousPaintStatus; 106 } previousPaintStatus;
107 ClipRects previousClipRects;
107 }; 108 };
108 109
109 static_assert(sizeof(PaintLayer) == sizeof(SameSizeAsPaintLayer), 110 static_assert(sizeof(PaintLayer) == sizeof(SameSizeAsPaintLayer),
110 "PaintLayer should stay small"); 111 "PaintLayer should stay small");
111 112
112 bool isReferenceClipPath(const ClipPathOperation* clipOperation) { 113 bool isReferenceClipPath(const ClipPathOperation* clipOperation) {
113 return clipOperation && clipOperation->type() == ClipPathOperation::REFERENCE; 114 return clipOperation && clipOperation->type() == ClipPathOperation::REFERENCE;
114 } 115 }
115 116
116 } // namespace 117 } // namespace
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 m_needsPaintPhaseDescendantOutlines(false), 150 m_needsPaintPhaseDescendantOutlines(false),
150 m_previousPaintPhaseDescendantOutlinesWasEmpty(false), 151 m_previousPaintPhaseDescendantOutlinesWasEmpty(false),
151 m_needsPaintPhaseFloat(false), 152 m_needsPaintPhaseFloat(false),
152 m_previousPaintPhaseFloatWasEmpty(false), 153 m_previousPaintPhaseFloatWasEmpty(false),
153 m_needsPaintPhaseDescendantBlockBackgrounds(false), 154 m_needsPaintPhaseDescendantBlockBackgrounds(false),
154 m_previousPaintPhaseDescendantBlockBackgroundsWasEmpty(false), 155 m_previousPaintPhaseDescendantBlockBackgroundsWasEmpty(false),
155 m_hasDescendantWithClipPath(false), 156 m_hasDescendantWithClipPath(false),
156 m_hasNonIsolatedDescendantWithBlendMode(false), 157 m_hasNonIsolatedDescendantWithBlendMode(false),
157 m_hasAncestorWithClipPath(false), 158 m_hasAncestorWithClipPath(false),
158 m_selfPaintingStatusChanged(false), 159 m_selfPaintingStatusChanged(false),
160 m_hasPreviousPaintingClipRects(false),
159 m_layoutObject(layoutObject), 161 m_layoutObject(layoutObject),
160 m_parent(0), 162 m_parent(0),
161 m_previous(0), 163 m_previous(0),
162 m_next(0), 164 m_next(0),
163 m_first(0), 165 m_first(0),
164 m_last(0), 166 m_last(0),
165 m_staticInlinePosition(0), 167 m_staticInlinePosition(0),
166 m_staticBlockPosition(0), 168 m_staticBlockPosition(0),
167 m_ancestorOverflowLayer(nullptr) { 169 m_ancestorOverflowLayer(nullptr) {
168 updateStackingNode(); 170 updateStackingNode();
(...skipping 3081 matching lines...) Expand 10 before | Expand all | Expand 10 after
3250 } 3252 }
3251 3253
3252 void showLayerTree(const blink::LayoutObject* layoutObject) { 3254 void showLayerTree(const blink::LayoutObject* layoutObject) {
3253 if (!layoutObject) { 3255 if (!layoutObject) {
3254 LOG(INFO) << "Cannot showLayerTree. Root is (nil)"; 3256 LOG(INFO) << "Cannot showLayerTree. Root is (nil)";
3255 return; 3257 return;
3256 } 3258 }
3257 showLayerTree(layoutObject->enclosingLayer()); 3259 showLayerTree(layoutObject->enclosingLayer());
3258 } 3260 }
3259 #endif 3261 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698