Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp

Issue 2387883002: Use float for scroll offset. (Closed)
Patch Set: rebase Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 context.current.shouldFlattenInheritedTransform = false; 560 context.current.shouldFlattenInheritedTransform = false;
561 context.current.renderingContextID = 0; 561 context.current.renderingContextID = 0;
562 } 562 }
563 563
564 void PaintPropertyTreeBuilder::updateScrollAndScrollTranslation( 564 void PaintPropertyTreeBuilder::updateScrollAndScrollTranslation(
565 const LayoutObject& object, 565 const LayoutObject& object,
566 PaintPropertyTreeBuilderContext& context) { 566 PaintPropertyTreeBuilderContext& context) {
567 if (object.hasOverflowClip()) { 567 if (object.hasOverflowClip()) {
568 const LayoutBox& box = toLayoutBox(object); 568 const LayoutBox& box = toLayoutBox(object);
569 const PaintLayerScrollableArea* scrollableArea = box.getScrollableArea(); 569 const PaintLayerScrollableArea* scrollableArea = box.getScrollableArea();
570 DoubleSize scrollOffset = box.scrolledContentOffset(); 570 IntSize scrollOffset = box.scrolledContentOffset();
571 if (!scrollOffset.isZero() || scrollableArea->scrollsOverflow()) { 571 if (!scrollOffset.isZero() || scrollableArea->scrollsOverflow()) {
572 TransformationMatrix matrix = TransformationMatrix().translate( 572 TransformationMatrix matrix = TransformationMatrix().translate(
573 -scrollOffset.width(), -scrollOffset.height()); 573 -scrollOffset.width(), -scrollOffset.height());
574 context.current.transform = 574 context.current.transform =
575 object.getMutableForPainting() 575 object.getMutableForPainting()
576 .ensureObjectPaintProperties() 576 .ensureObjectPaintProperties()
577 .createOrUpdateScrollTranslation( 577 .createOrUpdateScrollTranslation(
578 context.current.transform, matrix, FloatPoint3D(), 578 context.current.transform, matrix, FloatPoint3D(),
579 context.current.shouldFlattenInheritedTransform, 579 context.current.shouldFlattenInheritedTransform,
580 context.current.renderingContextID); 580 context.current.renderingContextID);
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 return; 742 return;
743 743
744 updateOverflowClip(object, context); 744 updateOverflowClip(object, context);
745 updatePerspective(object, context); 745 updatePerspective(object, context);
746 updateSvgLocalToBorderBoxTransform(object, context); 746 updateSvgLocalToBorderBoxTransform(object, context);
747 updateScrollAndScrollTranslation(object, context); 747 updateScrollAndScrollTranslation(object, context);
748 updateOutOfFlowContext(object, context); 748 updateOutOfFlowContext(object, context);
749 } 749 }
750 750
751 } // namespace blink 751 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698