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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 frameTranslate.translate(frameView.x() + context.current.paintOffset.x(), | 163 frameTranslate.translate(frameView.x() + context.current.paintOffset.x(), |
164 frameView.y() + context.current.paintOffset.y()); | 164 frameView.y() + context.current.paintOffset.y()); |
165 createOrUpdateFrameViewPreTranslation(frameView, context.current.transform, | 165 createOrUpdateFrameViewPreTranslation(frameView, context.current.transform, |
166 frameTranslate, FloatPoint3D()); | 166 frameTranslate, FloatPoint3D()); |
167 | 167 |
168 FloatRoundedRect contentClip( | 168 FloatRoundedRect contentClip( |
169 IntRect(IntPoint(), frameView.visibleContentSize())); | 169 IntRect(IntPoint(), frameView.visibleContentSize())); |
170 createOrUpdateFrameViewContentClip(frameView, context.current.clip, | 170 createOrUpdateFrameViewContentClip(frameView, context.current.clip, |
171 frameView.preTranslation(), contentClip); | 171 frameView.preTranslation(), contentClip); |
172 | 172 |
173 DoubleSize scrollOffset = frameView.scrollOffsetDouble(); | 173 ScrollOffset scrollOffset = frameView.scrollOffset(); |
174 if (frameView.isScrollable() || !scrollOffset.isZero()) { | 174 if (frameView.isScrollable() || !scrollOffset.isZero()) { |
175 TransformationMatrix frameScroll; | 175 TransformationMatrix frameScroll; |
176 frameScroll.translate(-scrollOffset.width(), -scrollOffset.height()); | 176 frameScroll.translate(-scrollOffset.width(), -scrollOffset.height()); |
177 createOrUpdateFrameViewScrollTranslation( | 177 createOrUpdateFrameViewScrollTranslation( |
178 frameView, frameView.preTranslation(), frameScroll, FloatPoint3D()); | 178 frameView, frameView.preTranslation(), frameScroll, FloatPoint3D()); |
179 | 179 |
180 IntSize scrollClip = frameView.visibleContentSize(); | 180 IntSize scrollClip = frameView.visibleContentSize(); |
181 IntSize scrollBounds = frameView.contentsSize(); | 181 IntSize scrollBounds = frameView.contentsSize(); |
182 bool userScrollableHorizontal = | 182 bool userScrollableHorizontal = |
183 frameView.userInputScrollable(HorizontalScrollbar); | 183 frameView.userInputScrollable(HorizontalScrollbar); |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 context.current.shouldFlattenInheritedTransform = false; | 567 context.current.shouldFlattenInheritedTransform = false; |
568 context.current.renderingContextID = 0; | 568 context.current.renderingContextID = 0; |
569 } | 569 } |
570 | 570 |
571 void PaintPropertyTreeBuilder::updateScrollAndScrollTranslation( | 571 void PaintPropertyTreeBuilder::updateScrollAndScrollTranslation( |
572 const LayoutObject& object, | 572 const LayoutObject& object, |
573 PaintPropertyTreeBuilderContext& context) { | 573 PaintPropertyTreeBuilderContext& context) { |
574 if (object.hasOverflowClip()) { | 574 if (object.hasOverflowClip()) { |
575 const LayoutBox& box = toLayoutBox(object); | 575 const LayoutBox& box = toLayoutBox(object); |
576 const PaintLayerScrollableArea* scrollableArea = box.getScrollableArea(); | 576 const PaintLayerScrollableArea* scrollableArea = box.getScrollableArea(); |
577 DoubleSize scrollOffset = box.scrolledContentOffset(); | 577 IntSize scrollOffset = box.scrolledContentOffset(); |
578 if (!scrollOffset.isZero() || scrollableArea->scrollsOverflow()) { | 578 if (!scrollOffset.isZero() || scrollableArea->scrollsOverflow()) { |
579 TransformationMatrix matrix = TransformationMatrix().translate( | 579 TransformationMatrix matrix = TransformationMatrix().translate( |
580 -scrollOffset.width(), -scrollOffset.height()); | 580 -scrollOffset.width(), -scrollOffset.height()); |
581 context.current.transform = | 581 context.current.transform = |
582 object.getMutableForPainting() | 582 object.getMutableForPainting() |
583 .ensureObjectPaintProperties() | 583 .ensureObjectPaintProperties() |
584 .createOrUpdateScrollTranslation( | 584 .createOrUpdateScrollTranslation( |
585 context.current.transform, matrix, FloatPoint3D(), | 585 context.current.transform, matrix, FloatPoint3D(), |
586 context.current.shouldFlattenInheritedTransform, | 586 context.current.shouldFlattenInheritedTransform, |
587 context.current.renderingContextID); | 587 context.current.renderingContextID); |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
753 return; | 753 return; |
754 | 754 |
755 updateOverflowClip(object, context); | 755 updateOverflowClip(object, context); |
756 updatePerspective(object, context); | 756 updatePerspective(object, context); |
757 updateSvgLocalToBorderBoxTransform(object, context); | 757 updateSvgLocalToBorderBoxTransform(object, context); |
758 updateScrollAndScrollTranslation(object, context); | 758 updateScrollAndScrollTranslation(object, context); |
759 updateOutOfFlowContext(object, context); | 759 updateOutOfFlowContext(object, context); |
760 } | 760 } |
761 | 761 |
762 } // namespace blink | 762 } // namespace blink |
OLD | NEW |