| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 frameView, frameView.preTranslation(), frameScroll, FloatPoint3D()); | 148 frameView, frameView.preTranslation(), frameScroll, FloatPoint3D()); |
| 149 | 149 |
| 150 IntSize scrollClip = frameView.visibleContentSize(); | 150 IntSize scrollClip = frameView.visibleContentSize(); |
| 151 IntSize scrollBounds = frameView.contentsSize(); | 151 IntSize scrollBounds = frameView.contentsSize(); |
| 152 bool userScrollableHorizontal = | 152 bool userScrollableHorizontal = |
| 153 frameView.userInputScrollable(HorizontalScrollbar); | 153 frameView.userInputScrollable(HorizontalScrollbar); |
| 154 bool userScrollableVertical = | 154 bool userScrollableVertical = |
| 155 frameView.userInputScrollable(VerticalScrollbar); | 155 frameView.userInputScrollable(VerticalScrollbar); |
| 156 | 156 |
| 157 MainThreadScrollingReasons reasons = 0; | 157 MainThreadScrollingReasons reasons = 0; |
| 158 if (!frameView.frame().settings()->threadedScrollingEnabled()) | 158 if (!frameView.frame().settings()->GetThreadedScrollingEnabled()) |
| 159 reasons |= MainThreadScrollingReason::kThreadedScrollingDisabled; | 159 reasons |= MainThreadScrollingReason::kThreadedScrollingDisabled; |
| 160 if (frameView.hasBackgroundAttachmentFixedObjects()) { | 160 if (frameView.hasBackgroundAttachmentFixedObjects()) { |
| 161 reasons |= | 161 reasons |= |
| 162 MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects; | 162 MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects; |
| 163 } | 163 } |
| 164 context.forceSubtreeUpdate |= updateScroll( | 164 context.forceSubtreeUpdate |= updateScroll( |
| 165 frameView, context.current.scroll, frameView.scrollTranslation(), | 165 frameView, context.current.scroll, frameView.scrollTranslation(), |
| 166 scrollClip, scrollBounds, userScrollableHorizontal, | 166 scrollClip, scrollBounds, userScrollableHorizontal, |
| 167 userScrollableVertical, reasons); | 167 userScrollableVertical, reasons); |
| 168 } else { | 168 } else { |
| (...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 684 context.current.shouldFlattenInheritedTransform = false; | 684 context.current.shouldFlattenInheritedTransform = false; |
| 685 context.current.renderingContextID = 0; | 685 context.current.renderingContextID = 0; |
| 686 } | 686 } |
| 687 // The paint offset is included in |transformToBorderBox| so SVG does not need | 687 // The paint offset is included in |transformToBorderBox| so SVG does not need |
| 688 // to handle paint offset internally. | 688 // to handle paint offset internally. |
| 689 context.current.paintOffset = LayoutPoint(); | 689 context.current.paintOffset = LayoutPoint(); |
| 690 } | 690 } |
| 691 | 691 |
| 692 MainThreadScrollingReasons mainScrollingReasons(const LayoutObject& object) { | 692 MainThreadScrollingReasons mainScrollingReasons(const LayoutObject& object) { |
| 693 MainThreadScrollingReasons reasons = 0; | 693 MainThreadScrollingReasons reasons = 0; |
| 694 if (!object.document().settings()->threadedScrollingEnabled()) | 694 if (!object.document().settings()->GetThreadedScrollingEnabled()) |
| 695 reasons |= MainThreadScrollingReason::kThreadedScrollingDisabled; | 695 reasons |= MainThreadScrollingReason::kThreadedScrollingDisabled; |
| 696 // Checking for descendants in the layout tree has two downsides: | 696 // Checking for descendants in the layout tree has two downsides: |
| 697 // 1) There can be more descendants in layout order than in paint order (e.g., | 697 // 1) There can be more descendants in layout order than in paint order (e.g., |
| 698 // fixed position objects). | 698 // fixed position objects). |
| 699 // 2) Iterating overall all background attachment fixed objects for every | 699 // 2) Iterating overall all background attachment fixed objects for every |
| 700 // scroll node can be slow, though there will be none in the common case. | 700 // scroll node can be slow, though there will be none in the common case. |
| 701 const FrameView& frameView = *object.frameView(); | 701 const FrameView& frameView = *object.frameView(); |
| 702 if (frameView.hasBackgroundAttachmentFixedDescendants(object)) | 702 if (frameView.hasBackgroundAttachmentFixedDescendants(object)) |
| 703 reasons |= MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects; | 703 reasons |= MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects; |
| 704 return reasons; | 704 return reasons; |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 963 updateOverflowClip(object, context); | 963 updateOverflowClip(object, context); |
| 964 updatePerspective(object, context); | 964 updatePerspective(object, context); |
| 965 updateSvgLocalToBorderBoxTransform(object, context); | 965 updateSvgLocalToBorderBoxTransform(object, context); |
| 966 updateScrollAndScrollTranslation(object, context); | 966 updateScrollAndScrollTranslation(object, context); |
| 967 updateOutOfFlowContext(object, context); | 967 updateOutOfFlowContext(object, context); |
| 968 | 968 |
| 969 context.forceSubtreeUpdate |= object.subtreeNeedsPaintPropertyUpdate(); | 969 context.forceSubtreeUpdate |= object.subtreeNeedsPaintPropertyUpdate(); |
| 970 } | 970 } |
| 971 | 971 |
| 972 } // namespace blink | 972 } // namespace blink |
| OLD | NEW |