| 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 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 FloatRoundedRect(FloatRect(clipRect))); | 619 FloatRoundedRect(FloatRect(clipRect))); |
| 620 } | 620 } |
| 621 | 621 |
| 622 const auto* properties = object.paintProperties(); | 622 const auto* properties = object.paintProperties(); |
| 623 if (properties && properties->overflowClip()) | 623 if (properties && properties->overflowClip()) |
| 624 context.current.clip = properties->overflowClip(); | 624 context.current.clip = properties->overflowClip(); |
| 625 } | 625 } |
| 626 | 626 |
| 627 static FloatPoint perspectiveOrigin(const LayoutBox& box) { | 627 static FloatPoint perspectiveOrigin(const LayoutBox& box) { |
| 628 const ComputedStyle& style = box.styleRef(); | 628 const ComputedStyle& style = box.styleRef(); |
| 629 // Perspective origin has no effect without perspective. |
| 630 DCHECK(style.hasPerspective()); |
| 629 FloatSize borderBoxSize(box.size()); | 631 FloatSize borderBoxSize(box.size()); |
| 630 return FloatPoint( | 632 return FloatPoint( |
| 631 floatValueForLength(style.perspectiveOriginX(), borderBoxSize.width()), | 633 floatValueForLength(style.perspectiveOriginX(), borderBoxSize.width()), |
| 632 floatValueForLength(style.perspectiveOriginY(), borderBoxSize.height())); | 634 floatValueForLength(style.perspectiveOriginY(), borderBoxSize.height())); |
| 633 } | 635 } |
| 634 | 636 |
| 635 void PaintPropertyTreeBuilder::updatePerspective( | 637 void PaintPropertyTreeBuilder::updatePerspective( |
| 636 const LayoutObject& object, | 638 const LayoutObject& object, |
| 637 PaintPropertyTreeBuilderContext& context) { | 639 PaintPropertyTreeBuilderContext& context) { |
| 638 if (object.needsPaintPropertyUpdate() || context.forceSubtreeUpdate) { | 640 if (object.needsPaintPropertyUpdate() || context.forceSubtreeUpdate) { |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 971 updateOverflowClip(object, context); | 973 updateOverflowClip(object, context); |
| 972 updatePerspective(object, context); | 974 updatePerspective(object, context); |
| 973 updateSvgLocalToBorderBoxTransform(object, context); | 975 updateSvgLocalToBorderBoxTransform(object, context); |
| 974 updateScrollAndScrollTranslation(object, context); | 976 updateScrollAndScrollTranslation(object, context); |
| 975 updateOutOfFlowContext(object, context); | 977 updateOutOfFlowContext(object, context); |
| 976 | 978 |
| 977 context.forceSubtreeUpdate |= object.subtreeNeedsPaintPropertyUpdate(); | 979 context.forceSubtreeUpdate |= object.subtreeNeedsPaintPropertyUpdate(); |
| 978 } | 980 } |
| 979 | 981 |
| 980 } // namespace blink | 982 } // namespace blink |
| OLD | NEW |