| 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 frameTranslate.translate(frameView.x() + context.current.paintOffset.x(), | 162 frameTranslate.translate(frameView.x() + context.current.paintOffset.x(), |
| 163 frameView.y() + context.current.paintOffset.y()); | 163 frameView.y() + context.current.paintOffset.y()); |
| 164 createOrUpdateFrameViewPreTranslation(frameView, context.current.transform, | 164 createOrUpdateFrameViewPreTranslation(frameView, context.current.transform, |
| 165 frameTranslate, FloatPoint3D()); | 165 frameTranslate, FloatPoint3D()); |
| 166 | 166 |
| 167 FloatRoundedRect contentClip( | 167 FloatRoundedRect contentClip( |
| 168 IntRect(IntPoint(), frameView.visibleContentSize())); | 168 IntRect(IntPoint(), frameView.visibleContentSize())); |
| 169 createOrUpdateFrameViewContentClip(frameView, context.current.clip, | 169 createOrUpdateFrameViewContentClip(frameView, context.current.clip, |
| 170 frameView.preTranslation(), contentClip); | 170 frameView.preTranslation(), contentClip); |
| 171 | 171 |
| 172 DoubleSize scrollOffset = frameView.scrollOffsetDouble(); | 172 ScrollOffset scrollOffset = frameView.scrollOffset(); |
| 173 if (frameView.isScrollable() || !scrollOffset.isZero()) { | 173 if (frameView.isScrollable() || !scrollOffset.isZero()) { |
| 174 TransformationMatrix frameScroll; | 174 TransformationMatrix frameScroll; |
| 175 frameScroll.translate(-scrollOffset.width(), -scrollOffset.height()); | 175 frameScroll.translate(-scrollOffset.width(), -scrollOffset.height()); |
| 176 createOrUpdateFrameViewScrollTranslation( | 176 createOrUpdateFrameViewScrollTranslation( |
| 177 frameView, frameView.preTranslation(), frameScroll, FloatPoint3D()); | 177 frameView, frameView.preTranslation(), frameScroll, FloatPoint3D()); |
| 178 | 178 |
| 179 IntSize scrollClip = frameView.visibleContentSize(); | 179 IntSize scrollClip = frameView.visibleContentSize(); |
| 180 IntSize scrollBounds = frameView.contentsSize(); | 180 IntSize scrollBounds = frameView.contentsSize(); |
| 181 bool userScrollableHorizontal = | 181 bool userScrollableHorizontal = |
| 182 frameView.userInputScrollable(HorizontalScrollbar); | 182 frameView.userInputScrollable(HorizontalScrollbar); |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 context.current.shouldFlattenInheritedTransform = false; | 561 context.current.shouldFlattenInheritedTransform = false; |
| 562 context.current.renderingContextID = 0; | 562 context.current.renderingContextID = 0; |
| 563 } | 563 } |
| 564 | 564 |
| 565 void PaintPropertyTreeBuilder::updateScrollAndScrollTranslation( | 565 void PaintPropertyTreeBuilder::updateScrollAndScrollTranslation( |
| 566 const LayoutObject& object, | 566 const LayoutObject& object, |
| 567 PaintPropertyTreeBuilderContext& context) { | 567 PaintPropertyTreeBuilderContext& context) { |
| 568 if (object.hasOverflowClip()) { | 568 if (object.hasOverflowClip()) { |
| 569 const LayoutBox& box = toLayoutBox(object); | 569 const LayoutBox& box = toLayoutBox(object); |
| 570 const PaintLayerScrollableArea* scrollableArea = box.getScrollableArea(); | 570 const PaintLayerScrollableArea* scrollableArea = box.getScrollableArea(); |
| 571 DoubleSize scrollOffset = box.scrolledContentOffset(); | 571 IntSize scrollOffset = box.scrolledContentOffset(); |
| 572 if (!scrollOffset.isZero() || scrollableArea->scrollsOverflow()) { | 572 if (!scrollOffset.isZero() || scrollableArea->scrollsOverflow()) { |
| 573 TransformationMatrix matrix = TransformationMatrix().translate( | 573 TransformationMatrix matrix = TransformationMatrix().translate( |
| 574 -scrollOffset.width(), -scrollOffset.height()); | 574 -scrollOffset.width(), -scrollOffset.height()); |
| 575 context.current.transform = | 575 context.current.transform = |
| 576 object.getMutableForPainting() | 576 object.getMutableForPainting() |
| 577 .ensureObjectPaintProperties() | 577 .ensureObjectPaintProperties() |
| 578 .createOrUpdateScrollTranslation( | 578 .createOrUpdateScrollTranslation( |
| 579 context.current.transform, matrix, FloatPoint3D(), | 579 context.current.transform, matrix, FloatPoint3D(), |
| 580 context.current.shouldFlattenInheritedTransform, | 580 context.current.shouldFlattenInheritedTransform, |
| 581 context.current.renderingContextID); | 581 context.current.renderingContextID); |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 743 return; | 743 return; |
| 744 | 744 |
| 745 updateOverflowClip(object, context); | 745 updateOverflowClip(object, context); |
| 746 updatePerspective(object, context); | 746 updatePerspective(object, context); |
| 747 updateSvgLocalToBorderBoxTransform(object, context); | 747 updateSvgLocalToBorderBoxTransform(object, context); |
| 748 updateScrollAndScrollTranslation(object, context); | 748 updateScrollAndScrollTranslation(object, context); |
| 749 updateOutOfFlowContext(object, context); | 749 updateOutOfFlowContext(object, context); |
| 750 } | 750 } |
| 751 | 751 |
| 752 } // namespace blink | 752 } // namespace blink |
| OLD | NEW |