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

Side by Side Diff: third_party/WebKit/Source/core/paint/BackgroundImageGeometry.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/BackgroundImageGeometry.h" 5 #include "core/paint/BackgroundImageGeometry.h"
6 6
7 #include "core/frame/FrameView.h" 7 #include "core/frame/FrameView.h"
8 #include "core/layout/LayoutBox.h" 8 #include "core/layout/LayoutBox.h"
9 #include "core/layout/LayoutBoxModelObject.h" 9 #include "core/layout/LayoutBoxModelObject.h"
10 #include "core/layout/LayoutView.h" 10 #include "core/layout/LayoutView.h"
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 paintRect.size() - LayoutSize(left + right, top + bottom); 378 paintRect.size() - LayoutSize(left + right, top + bottom);
379 } 379 }
380 } else { 380 } else {
381 setHasNonLocalGeometry(); 381 setHasNonLocalGeometry();
382 382
383 LayoutRect viewportRect = obj.viewRect(); 383 LayoutRect viewportRect = obj.viewRect();
384 if (fixedBackgroundPaintsInLocalCoordinates(obj, globalPaintFlags)) { 384 if (fixedBackgroundPaintsInLocalCoordinates(obj, globalPaintFlags)) {
385 viewportRect.setLocation(LayoutPoint()); 385 viewportRect.setLocation(LayoutPoint());
386 } else { 386 } else {
387 if (FrameView* frameView = obj.view()->frameView()) 387 if (FrameView* frameView = obj.view()->frameView())
388 viewportRect.setLocation(frameView->scrollPosition()); 388 viewportRect.setLocation(IntPoint(frameView->scrollOffsetInt()));
389 // Compensate the translations created by ScrollRecorders. 389 // Compensate the translations created by ScrollRecorders.
390 // TODO(trchen): Fix this for SP phase 2. crbug.com/529963. 390 // TODO(trchen): Fix this for SP phase 2. crbug.com/529963.
391 viewportRect.moveBy( 391 viewportRect.moveBy(
392 accumulatedScrollOffsetForFixedBackground(obj, paintContainer)); 392 accumulatedScrollOffsetForFixedBackground(obj, paintContainer));
393 } 393 }
394 394
395 if (paintContainer) 395 if (paintContainer)
396 viewportRect.moveBy( 396 viewportRect.moveBy(
397 LayoutPoint(-paintContainer->localToAbsolute(FloatPoint()))); 397 LayoutPoint(-paintContainer->localToAbsolute(FloatPoint())));
398 398
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 useFixedAttachment(paintRect.location()); 512 useFixedAttachment(paintRect.location());
513 513
514 // Clip the final output rect to the paint rect 514 // Clip the final output rect to the paint rect
515 m_destRect.intersect(paintRect); 515 m_destRect.intersect(paintRect);
516 516
517 // Snap as-yet unsnapped values. 517 // Snap as-yet unsnapped values.
518 setDestRect(LayoutRect(pixelSnappedIntRect(m_destRect))); 518 setDestRect(LayoutRect(pixelSnappedIntRect(m_destRect)));
519 } 519 }
520 520
521 } // namespace blink 521 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698