| OLD | NEW |
| 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 Loading... |
| 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->propertyTreeState = PropertyTreeState(context.current.tran
sform, context.current.clip, context.currentEffect); | 299 borderBoxContext->geometryPropertyTreeState = GeometryPropertyTreeState(cont
ext.current.transform, context.current.clip, context.currentEffect); |
| 300 borderBoxContext->scroll = context.current.scroll; | 300 borderBoxContext->scroll = context.current.scroll; |
| 301 | 301 |
| 302 if (!context.current.clip) { | 302 if (!context.current.clip) { |
| 303 DCHECK(object.isLayoutView()); | 303 DCHECK(object.isLayoutView()); |
| 304 DCHECK(toLayoutView(object).frameView()->frame().isMainFrame()); | 304 DCHECK(toLayoutView(object).frameView()->frame().isMainFrame()); |
| 305 DCHECK(RuntimeEnabledFeatures::rootLayerScrollingEnabled()); | 305 DCHECK(RuntimeEnabledFeatures::rootLayerScrollingEnabled()); |
| 306 borderBoxContext->propertyTreeState.clip = ClipPaintPropertyNode::create
(nullptr, context.current.transform, FloatRoundedRect(LayoutRect::infiniteIntRec
t())); | 306 borderBoxContext->geometryPropertyTreeState.clip = ClipPaintPropertyNode
::create(nullptr, context.current.transform, FloatRoundedRect(LayoutRect::infini
teIntRect())); |
| 307 context.current.clip = borderBoxContext->propertyTreeState.clip.get(); | 307 context.current.clip = borderBoxContext->geometryPropertyTreeState.clip.
get(); |
| 308 } | 308 } |
| 309 | 309 |
| 310 object.getMutableForPainting().ensureObjectPaintProperties().setLocalBorderB
oxProperties(std::move(borderBoxContext)); | 310 object.getMutableForPainting().ensureObjectPaintProperties().setLocalBorderB
oxProperties(std::move(borderBoxContext)); |
| 311 | 311 |
| 312 } | 312 } |
| 313 | 313 |
| 314 // TODO(trchen): Remove this once we bake the paint offset into frameRect. | 314 // TODO(trchen): Remove this once we bake the paint offset into frameRect. |
| 315 void PaintPropertyTreeBuilder::updateScrollbarPaintOffset(const LayoutObject& ob
ject, const PaintPropertyTreeBuilderContext& context) | 315 void PaintPropertyTreeBuilder::updateScrollbarPaintOffset(const LayoutObject& ob
ject, const PaintPropertyTreeBuilderContext& context) |
| 316 { | 316 { |
| 317 IntPoint roundedPaintOffset = roundedIntPoint(context.current.paintOffset); | 317 IntPoint roundedPaintOffset = roundedIntPoint(context.current.paintOffset); |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 return; | 555 return; |
| 556 | 556 |
| 557 updateOverflowClip(object, context); | 557 updateOverflowClip(object, context); |
| 558 updatePerspective(object, context); | 558 updatePerspective(object, context); |
| 559 updateSvgLocalToBorderBoxTransform(object, context); | 559 updateSvgLocalToBorderBoxTransform(object, context); |
| 560 updateScrollAndScrollTranslation(object, context); | 560 updateScrollAndScrollTranslation(object, context); |
| 561 updateOutOfFlowContext(object, context); | 561 updateOutOfFlowContext(object, context); |
| 562 } | 562 } |
| 563 | 563 |
| 564 } // namespace blink | 564 } // namespace blink |
| OLD | NEW |