| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 DEFINE_STATIC_REF(ScrollPaintPropertyNode, rootScroll, (ScrollPaintPrope
rtyNode::create(nullptr, rootTransformNode(), IntSize(), IntSize(), false, false
))); | 44 DEFINE_STATIC_REF(ScrollPaintPropertyNode, rootScroll, (ScrollPaintPrope
rtyNode::create(nullptr, rootTransformNode(), IntSize(), IntSize(), false, false
))); |
| 45 return rootScroll; | 45 return rootScroll; |
| 46 } | 46 } |
| 47 } | 47 } |
| 48 | 48 |
| 49 PaintPropertyTreeBuilderContext PaintPropertyTreeBuilder::setupInitialContext() | 49 PaintPropertyTreeBuilderContext PaintPropertyTreeBuilder::setupInitialContext() |
| 50 { | 50 { |
| 51 PaintPropertyTreeBuilderContext context; | 51 PaintPropertyTreeBuilderContext context; |
| 52 | 52 |
| 53 context.current.clip = context.absolutePosition.clip = context.fixedPosition
.clip = rootClipNode(); | 53 context.current.clip = context.absolutePosition.clip = context.fixedPosition
.clip = rootClipNode(); |
| 54 context.currentEffect = rootEffectNode(); |
| 54 | 55 |
| 55 // TODO(pdr): Update the root layer scrolling paths to use the static root n
odes for transform, effect, and scroll. | 56 // TODO(pdr): Update the root layer scrolling paths to use the static root n
odes for transform and scroll. |
| 56 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) | 57 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) |
| 57 return context; | 58 return context; |
| 58 | 59 |
| 59 context.current.transform = context.absolutePosition.transform = context.fix
edPosition.transform = rootTransformNode(); | 60 context.current.transform = context.absolutePosition.transform = context.fix
edPosition.transform = rootTransformNode(); |
| 60 context.current.scroll = context.absolutePosition.scroll = context.fixedPosi
tion.scroll = rootScrollNode(); | 61 context.current.scroll = context.absolutePosition.scroll = context.fixedPosi
tion.scroll = rootScrollNode(); |
| 61 context.currentEffect = rootEffectNode(); | |
| 62 | 62 |
| 63 // Ensure scroll tree properties are reset. They will be rebuilt during the
tree walk. | 63 // Ensure scroll tree properties are reset. They will be rebuilt during the
tree walk. |
| 64 rootScrollNode()->clearMainThreadScrollingReasons(); | 64 rootScrollNode()->clearMainThreadScrollingReasons(); |
| 65 | 65 |
| 66 return context; | 66 return context; |
| 67 } | 67 } |
| 68 | 68 |
| 69 void createOrUpdateFrameViewPreTranslation(FrameView& frameView, | 69 void createOrUpdateFrameViewPreTranslation(FrameView& frameView, |
| 70 PassRefPtr<const TransformPaintPropertyNode> parent, | 70 PassRefPtr<const TransformPaintPropertyNode> parent, |
| 71 const TransformationMatrix& matrix, | 71 const TransformationMatrix& matrix, |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 return; | 272 return; |
| 273 } | 273 } |
| 274 } | 274 } |
| 275 | 275 |
| 276 if (ObjectPaintProperties* properties = object.getMutableForPainting().objec
tPaintProperties()) | 276 if (ObjectPaintProperties* properties = object.getMutableForPainting().objec
tPaintProperties()) |
| 277 properties->clearTransform(); | 277 properties->clearTransform(); |
| 278 } | 278 } |
| 279 | 279 |
| 280 void PaintPropertyTreeBuilder::updateEffect(const LayoutObject& object, PaintPro
pertyTreeBuilderContext& context) | 280 void PaintPropertyTreeBuilder::updateEffect(const LayoutObject& object, PaintPro
pertyTreeBuilderContext& context) |
| 281 { | 281 { |
| 282 if (object.isLayoutView() && !context.currentEffect) { | |
| 283 const LayoutView& layoutView = toLayoutView(object); | |
| 284 DCHECK(RuntimeEnabledFeatures::rootLayerScrollingEnabled()); | |
| 285 DCHECK(layoutView.frameView()->frame().isMainFrame()); | |
| 286 context.currentEffect = layoutView.getMutableForPainting().ensureObjectP
aintProperties().createOrUpdateEffect(nullptr, 1.0); | |
| 287 return; | |
| 288 } | |
| 289 | |
| 290 if (!object.styleRef().hasOpacity()) { | 282 if (!object.styleRef().hasOpacity()) { |
| 291 if (ObjectPaintProperties* properties = object.getMutableForPainting().o
bjectPaintProperties()) | 283 if (ObjectPaintProperties* properties = object.getMutableForPainting().o
bjectPaintProperties()) |
| 292 properties->clearEffect(); | 284 properties->clearEffect(); |
| 293 return; | 285 return; |
| 294 } | 286 } |
| 295 | 287 |
| 296 context.currentEffect = object.getMutableForPainting().ensureObjectPaintProp
erties().createOrUpdateEffect( | 288 context.currentEffect = object.getMutableForPainting().ensureObjectPaintProp
erties().createOrUpdateEffect( |
| 297 context.currentEffect, object.styleRef().opacity()); | 289 context.currentEffect, object.styleRef().opacity()); |
| 298 } | 290 } |
| 299 | 291 |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 590 return; | 582 return; |
| 591 | 583 |
| 592 updateOverflowClip(object, context); | 584 updateOverflowClip(object, context); |
| 593 updatePerspective(object, context); | 585 updatePerspective(object, context); |
| 594 updateSvgLocalToBorderBoxTransform(object, context); | 586 updateSvgLocalToBorderBoxTransform(object, context); |
| 595 updateScrollAndScrollTranslation(object, context); | 587 updateScrollAndScrollTranslation(object, context); |
| 596 updateOutOfFlowContext(object, context); | 588 updateOutOfFlowContext(object, context); |
| 597 } | 589 } |
| 598 | 590 |
| 599 } // namespace blink | 591 } // namespace blink |
| OLD | NEW |