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

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

Issue 2351433002: Switch LocalBorderBoxProperties to store raw pointers (Closed)
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 // 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/PaintPropertyTreeBuilder.h" 5 #include "core/paint/PaintPropertyTreeBuilder.h"
6 6
7 #include "core/frame/FrameView.h" 7 #include "core/frame/FrameView.h"
8 #include "core/frame/LocalFrame.h" 8 #include "core/frame/LocalFrame.h"
9 #include "core/frame/Settings.h" 9 #include "core/frame/Settings.h"
10 #include "core/layout/LayoutInline.h" 10 #include "core/layout/LayoutInline.h"
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 289
290 void PaintPropertyTreeBuilder::updateLocalBorderBoxContext(const LayoutObject& o bject, PaintPropertyTreeBuilderContext& context) 290 void PaintPropertyTreeBuilder::updateLocalBorderBoxContext(const LayoutObject& o bject, PaintPropertyTreeBuilderContext& context)
291 { 291 {
292 // Avoid adding an ObjectPaintProperties for non-boxes to save memory, since we don't need them at the moment. 292 // Avoid adding an ObjectPaintProperties for non-boxes to save memory, since we don't need them at the moment.
293 if (!object.isBox() && !object.hasLayer()) 293 if (!object.isBox() && !object.hasLayer())
294 return; 294 return;
295 295
296 std::unique_ptr<ObjectPaintProperties::LocalBorderBoxProperties> borderBoxCo ntext = 296 std::unique_ptr<ObjectPaintProperties::LocalBorderBoxProperties> borderBoxCo ntext =
297 wrapUnique(new ObjectPaintProperties::LocalBorderBoxProperties); 297 wrapUnique(new ObjectPaintProperties::LocalBorderBoxProperties);
298 borderBoxContext->paintOffset = context.current.paintOffset; 298 borderBoxContext->paintOffset = context.current.paintOffset;
299 borderBoxContext->geometryPropertyTreeState = GeometryPropertyTreeState(cont ext.current.transform, context.current.clip, context.currentEffect); 299 borderBoxContext->transform = context.current.transform;
300 borderBoxContext->clip = context.current.clip;
301 borderBoxContext->effect = context.currentEffect;
300 borderBoxContext->scroll = context.current.scroll; 302 borderBoxContext->scroll = context.current.scroll;
301 303
302 if (!context.current.clip) {
303 DCHECK(object.isLayoutView());
304 DCHECK(toLayoutView(object).frameView()->frame().isMainFrame());
305 DCHECK(RuntimeEnabledFeatures::rootLayerScrollingEnabled());
306 borderBoxContext->geometryPropertyTreeState.clip = ClipPaintPropertyNode ::create(nullptr, context.current.transform, FloatRoundedRect(LayoutRect::infini teIntRect()));
307 context.current.clip = borderBoxContext->geometryPropertyTreeState.clip. get();
308 }
309
310 object.getMutableForPainting().ensureObjectPaintProperties().setLocalBorderB oxProperties(std::move(borderBoxContext)); 304 object.getMutableForPainting().ensureObjectPaintProperties().setLocalBorderB oxProperties(std::move(borderBoxContext));
311 305
312 } 306 }
313 307
314 // TODO(trchen): Remove this once we bake the paint offset into frameRect. 308 // TODO(trchen): Remove this once we bake the paint offset into frameRect.
315 void PaintPropertyTreeBuilder::updateScrollbarPaintOffset(const LayoutObject& ob ject, const PaintPropertyTreeBuilderContext& context) 309 void PaintPropertyTreeBuilder::updateScrollbarPaintOffset(const LayoutObject& ob ject, const PaintPropertyTreeBuilderContext& context)
316 { 310 {
317 IntPoint roundedPaintOffset = roundedIntPoint(context.current.paintOffset); 311 IntPoint roundedPaintOffset = roundedIntPoint(context.current.paintOffset);
318 if (roundedPaintOffset != IntPoint() && object.isBoxModelObject()) { 312 if (roundedPaintOffset != IntPoint() && object.isBoxModelObject()) {
319 if (PaintLayerScrollableArea* scrollableArea = toLayoutBoxModelObject(ob ject).getScrollableArea()) { 313 if (PaintLayerScrollableArea* scrollableArea = toLayoutBoxModelObject(ob ject).getScrollableArea()) {
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 return; 549 return;
556 550
557 updateOverflowClip(object, context); 551 updateOverflowClip(object, context);
558 updatePerspective(object, context); 552 updatePerspective(object, context);
559 updateSvgLocalToBorderBoxTransform(object, context); 553 updateSvgLocalToBorderBoxTransform(object, context);
560 updateScrollAndScrollTranslation(object, context); 554 updateScrollAndScrollTranslation(object, context);
561 updateOutOfFlowContext(object, context); 555 updateOutOfFlowContext(object, context);
562 } 556 }
563 557
564 } // namespace blink 558 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698