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

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

Issue 2782343002: Store local border box property cache outside ObjectPaintProperties (Closed)
Patch Set: Rebase 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
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/paint/PrePaintTreeWalk.h" 5 #include "core/paint/PrePaintTreeWalk.h"
6 6
7 #include "core/dom/DocumentLifecycle.h" 7 #include "core/dom/DocumentLifecycle.h"
8 #include "core/frame/FrameView.h" 8 #include "core/frame/FrameView.h"
9 #include "core/frame/LocalFrame.h" 9 #include "core/frame/LocalFrame.h"
10 #include "core/layout/LayoutMultiColumnSpannerPlaceholder.h" 10 #include "core/layout/LayoutMultiColumnSpannerPlaceholder.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 PrePaintTreeWalkContext& context) { 128 PrePaintTreeWalkContext& context) {
129 if (!object.hasLayer()) 129 if (!object.hasLayer())
130 return; 130 return;
131 131
132 PaintLayer& paintLayer = *toLayoutBoxModelObject(object).layer(); 132 PaintLayer& paintLayer = *toLayoutBoxModelObject(object).layer();
133 if (object.styleRef().hasTransform() || 133 if (object.styleRef().hasTransform() ||
134 &object == context.paintInvalidatorContext.paintInvalidationContainer) { 134 &object == context.paintInvalidatorContext.paintInvalidationContainer) {
135 context.ancestorTransformedOrRootPaintLayer = &paintLayer; 135 context.ancestorTransformedOrRootPaintLayer = &paintLayer;
136 } 136 }
137 137
138 const ObjectPaintProperties& ancestorPaintProperties = 138 const auto& ancestor =
139 *context.ancestorTransformedOrRootPaintLayer->layoutObject() 139 context.ancestorTransformedOrRootPaintLayer->layoutObject();
140 .paintProperties(); 140 PropertyTreeState ancestorState = *ancestor.localBorderBoxProperties();
141 PropertyTreeState ancestorState =
142 *ancestorPaintProperties.localBorderBoxProperties();
143 141
144 #ifdef CHECK_CLIP_RECTS 142 #ifdef CHECK_CLIP_RECTS
145 ShouldRespectOverflowClipType respectOverflowClip = RespectOverflowClip; 143 ShouldRespectOverflowClipType respectOverflowClip = RespectOverflowClip;
146 #endif 144 #endif
147 if (context.ancestorTransformedOrRootPaintLayer->compositingState() == 145 if (context.ancestorTransformedOrRootPaintLayer->compositingState() ==
148 PaintsIntoOwnBacking && 146 PaintsIntoOwnBacking) {
149 ancestorPaintProperties.overflowClip()) { 147 const auto* ancestorProperties = ancestor.paintProperties();
150 ancestorState.setClip(ancestorPaintProperties.overflowClip()); 148 if (ancestorProperties && ancestorProperties->overflowClip()) {
149 ancestorState.setClip(ancestorProperties->overflowClip());
151 #ifdef CHECK_CLIP_RECTS 150 #ifdef CHECK_CLIP_RECTS
152 respectOverflowClip = IgnoreOverflowClip; 151 respectOverflowClip = IgnoreOverflowClip;
153 #endif 152 #endif
153 }
154 } 154 }
155 155
156 #ifdef CHECK_CLIP_RECTS 156 #ifdef CHECK_CLIP_RECTS
157 ClipRects& oldClipRects = 157 ClipRects& oldClipRects =
158 paintLayer.clipper(PaintLayer::DoNotUseGeometryMapper) 158 paintLayer.clipper(PaintLayer::DoNotUseGeometryMapper)
159 .paintingClipRects(&ancestorTransformedOrRootPaintLayer, 159 .paintingClipRects(&ancestorTransformedOrRootPaintLayer,
160 respectOverflowClip, LayoutSize()); 160 respectOverflowClip, LayoutSize());
161 #endif 161 #endif
162 162
163 ClipRects clipRects; 163 ClipRects clipRects;
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 roundedIntPoint(context.treeBuilderContext->current.paintOffset); 257 roundedIntPoint(context.treeBuilderContext->current.paintOffset);
258 walk(*toFrameView(frameViewBase), context); 258 walk(*toFrameView(frameViewBase), context);
259 } 259 }
260 // TODO(pdr): Investigate RemoteFrameView (crbug.com/579281). 260 // TODO(pdr): Investigate RemoteFrameView (crbug.com/579281).
261 } 261 }
262 262
263 object.getMutableForPainting().clearPaintFlags(); 263 object.getMutableForPainting().clearPaintFlags();
264 } 264 }
265 265
266 } // namespace blink 266 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698