| 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/dom/DOMNodeIds.h" | 7 #include "core/dom/DOMNodeIds.h" |
| 8 #include "core/frame/FrameView.h" | 8 #include "core/frame/FrameView.h" |
| 9 #include "core/frame/LocalFrame.h" | 9 #include "core/frame/LocalFrame.h" |
| 10 #include "core/frame/Settings.h" | 10 #include "core/frame/Settings.h" |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 frameView, frameView.preTranslation(), frameScroll, FloatPoint3D()); | 150 frameView, frameView.preTranslation(), frameScroll, FloatPoint3D()); |
| 151 | 151 |
| 152 IntSize scrollClip = frameView.visibleContentSize(); | 152 IntSize scrollClip = frameView.visibleContentSize(); |
| 153 IntSize scrollBounds = frameView.contentsSize(); | 153 IntSize scrollBounds = frameView.contentsSize(); |
| 154 bool userScrollableHorizontal = | 154 bool userScrollableHorizontal = |
| 155 frameView.userInputScrollable(HorizontalScrollbar); | 155 frameView.userInputScrollable(HorizontalScrollbar); |
| 156 bool userScrollableVertical = | 156 bool userScrollableVertical = |
| 157 frameView.userInputScrollable(VerticalScrollbar); | 157 frameView.userInputScrollable(VerticalScrollbar); |
| 158 | 158 |
| 159 MainThreadScrollingReasons reasons = 0; | 159 MainThreadScrollingReasons reasons = 0; |
| 160 if (!frameView.frame().settings()->threadedScrollingEnabled()) | 160 if (!frameView.frame().settings()->getThreadedScrollingEnabled()) |
| 161 reasons |= MainThreadScrollingReason::kThreadedScrollingDisabled; | 161 reasons |= MainThreadScrollingReason::kThreadedScrollingDisabled; |
| 162 if (frameView.hasBackgroundAttachmentFixedObjects()) { | 162 if (frameView.hasBackgroundAttachmentFixedObjects()) { |
| 163 reasons |= | 163 reasons |= |
| 164 MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects; | 164 MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects; |
| 165 } | 165 } |
| 166 context.forceSubtreeUpdate |= updateScroll( | 166 context.forceSubtreeUpdate |= updateScroll( |
| 167 frameView, context.current.scroll, frameView.scrollTranslation(), | 167 frameView, context.current.scroll, frameView.scrollTranslation(), |
| 168 scrollClip, scrollBounds, userScrollableHorizontal, | 168 scrollClip, scrollBounds, userScrollableHorizontal, |
| 169 userScrollableVertical, reasons); | 169 userScrollableVertical, reasons); |
| 170 } else { | 170 } else { |
| (...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 730 context.current.shouldFlattenInheritedTransform = false; | 730 context.current.shouldFlattenInheritedTransform = false; |
| 731 context.current.renderingContextId = 0; | 731 context.current.renderingContextId = 0; |
| 732 } | 732 } |
| 733 // The paint offset is included in |transformToBorderBox| so SVG does not need | 733 // The paint offset is included in |transformToBorderBox| so SVG does not need |
| 734 // to handle paint offset internally. | 734 // to handle paint offset internally. |
| 735 context.current.paintOffset = LayoutPoint(); | 735 context.current.paintOffset = LayoutPoint(); |
| 736 } | 736 } |
| 737 | 737 |
| 738 MainThreadScrollingReasons mainScrollingReasons(const LayoutObject& object) { | 738 MainThreadScrollingReasons mainScrollingReasons(const LayoutObject& object) { |
| 739 MainThreadScrollingReasons reasons = 0; | 739 MainThreadScrollingReasons reasons = 0; |
| 740 if (!object.document().settings()->threadedScrollingEnabled()) | 740 if (!object.document().settings()->getThreadedScrollingEnabled()) |
| 741 reasons |= MainThreadScrollingReason::kThreadedScrollingDisabled; | 741 reasons |= MainThreadScrollingReason::kThreadedScrollingDisabled; |
| 742 // Checking for descendants in the layout tree has two downsides: | 742 // Checking for descendants in the layout tree has two downsides: |
| 743 // 1) There can be more descendants in layout order than in paint order (e.g., | 743 // 1) There can be more descendants in layout order than in paint order (e.g., |
| 744 // fixed position objects). | 744 // fixed position objects). |
| 745 // 2) Iterating overall all background attachment fixed objects for every | 745 // 2) Iterating overall all background attachment fixed objects for every |
| 746 // scroll node can be slow, though there will be none in the common case. | 746 // scroll node can be slow, though there will be none in the common case. |
| 747 const FrameView& frameView = *object.frameView(); | 747 const FrameView& frameView = *object.frameView(); |
| 748 if (frameView.hasBackgroundAttachmentFixedDescendants(object)) | 748 if (frameView.hasBackgroundAttachmentFixedDescendants(object)) |
| 749 reasons |= MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects; | 749 reasons |= MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects; |
| 750 return reasons; | 750 return reasons; |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1009 updateOverflowClip(object, context); | 1009 updateOverflowClip(object, context); |
| 1010 updatePerspective(object, context); | 1010 updatePerspective(object, context); |
| 1011 updateSvgLocalToBorderBoxTransform(object, context); | 1011 updateSvgLocalToBorderBoxTransform(object, context); |
| 1012 updateScrollAndScrollTranslation(object, context); | 1012 updateScrollAndScrollTranslation(object, context); |
| 1013 updateOutOfFlowContext(object, context); | 1013 updateOutOfFlowContext(object, context); |
| 1014 | 1014 |
| 1015 context.forceSubtreeUpdate |= object.subtreeNeedsPaintPropertyUpdate(); | 1015 context.forceSubtreeUpdate |= object.subtreeNeedsPaintPropertyUpdate(); |
| 1016 } | 1016 } |
| 1017 | 1017 |
| 1018 } // namespace blink | 1018 } // namespace blink |
| OLD | NEW |