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

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: 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 // 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 PrePaintTreeWalkContext& context) { 146 PrePaintTreeWalkContext& context) {
147 if (!object.hasLayer()) 147 if (!object.hasLayer())
148 return; 148 return;
149 149
150 PaintLayer& paintLayer = *toLayoutBoxModelObject(object).layer(); 150 PaintLayer& paintLayer = *toLayoutBoxModelObject(object).layer();
151 if (object.styleRef().hasTransform() || 151 if (object.styleRef().hasTransform() ||
152 &object == context.paintInvalidatorContext.paintInvalidationContainer) { 152 &object == context.paintInvalidatorContext.paintInvalidationContainer) {
153 context.ancestorTransformedOrRootPaintLayer = &paintLayer; 153 context.ancestorTransformedOrRootPaintLayer = &paintLayer;
154 } 154 }
155 155
156 const ObjectPaintProperties& ancestorPaintProperties = 156 const auto& ancestor =
157 *context.ancestorTransformedOrRootPaintLayer->layoutObject() 157 context.ancestorTransformedOrRootPaintLayer->layoutObject();
158 .paintProperties(); 158 PropertyTreeState ancestorState = *ancestor.localBorderBoxProperties();
159 PropertyTreeState ancestorState =
160 *ancestorPaintProperties.localBorderBoxProperties();
161 159
162 #ifdef CHECK_CLIP_RECTS 160 #ifdef CHECK_CLIP_RECTS
163 ShouldRespectOverflowClipType respectOverflowClip = RespectOverflowClip; 161 ShouldRespectOverflowClipType respectOverflowClip = RespectOverflowClip;
164 #endif 162 #endif
165 if (context.ancestorTransformedOrRootPaintLayer->compositingState() == 163 if (context.ancestorTransformedOrRootPaintLayer->compositingState() ==
166 PaintsIntoOwnBacking && 164 PaintsIntoOwnBacking) {
167 ancestorPaintProperties.overflowClip()) { 165 const auto* ancestorProperties = ancestor.paintProperties();
168 ancestorState.setClip(ancestorPaintProperties.overflowClip()); 166 if (ancestorProperties && ancestorProperties->overflowClip()) {
167 ancestorState.setClip(ancestorProperties->overflowClip());
169 #ifdef CHECK_CLIP_RECTS 168 #ifdef CHECK_CLIP_RECTS
170 respectOverflowClip = IgnoreOverflowClip; 169 respectOverflowClip = IgnoreOverflowClip;
171 #endif 170 #endif
171 }
172 } 172 }
173 173
174 #ifdef CHECK_CLIP_RECTS 174 #ifdef CHECK_CLIP_RECTS
175 ClipRects& oldClipRects = 175 ClipRects& oldClipRects =
176 paintLayer.clipper(PaintLayer::DoNotUseGeometryMapper) 176 paintLayer.clipper(PaintLayer::DoNotUseGeometryMapper)
177 .paintingClipRects(&ancestorTransformedOrRootPaintLayer, 177 .paintingClipRects(&ancestorTransformedOrRootPaintLayer,
178 respectOverflowClip, LayoutSize()); 178 respectOverflowClip, LayoutSize());
179 #endif 179 #endif
180 180
181 bool hasClip = false; 181 bool hasClip = false;
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 roundedIntPoint(context.treeBuilderContext->current.paintOffset); 280 roundedIntPoint(context.treeBuilderContext->current.paintOffset);
281 walk(*toFrameView(frameViewBase), context); 281 walk(*toFrameView(frameViewBase), context);
282 } 282 }
283 // TODO(pdr): Investigate RemoteFrameView (crbug.com/579281). 283 // TODO(pdr): Investigate RemoteFrameView (crbug.com/579281).
284 } 284 }
285 285
286 object.getMutableForPainting().clearPaintFlags(); 286 object.getMutableForPainting().clearPaintFlags();
287 } 287 }
288 288
289 } // namespace blink 289 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698