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

Side by Side Diff: third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp

Issue 2387883002: Use float for scroll offset. (Closed)
Patch Set: Fix README.md 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 /* 1 /*
2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 649
650 enum AcceleratedFixedRootBackgroundHistogramBuckets { 650 enum AcceleratedFixedRootBackgroundHistogramBuckets {
651 ScrolledMainFrameBucket = 0, 651 ScrolledMainFrameBucket = 0,
652 ScrolledMainFrameWithAcceleratedFixedRootBackground = 1, 652 ScrolledMainFrameWithAcceleratedFixedRootBackground = 1,
653 ScrolledMainFrameWithUnacceleratedFixedRootBackground = 2, 653 ScrolledMainFrameWithUnacceleratedFixedRootBackground = 2,
654 AcceleratedFixedRootBackgroundHistogramMax = 3 654 AcceleratedFixedRootBackgroundHistogramMax = 3
655 }; 655 };
656 656
657 void PaintLayerCompositor::frameViewDidScroll() { 657 void PaintLayerCompositor::frameViewDidScroll() {
658 FrameView* frameView = m_layoutView.frameView(); 658 FrameView* frameView = m_layoutView.frameView();
659 IntPoint scrollPosition = frameView->scrollPosition(); 659 IntSize scrollOffset = frameView->scrollOffsetInt();
660 660
661 if (!m_scrollLayer) 661 if (!m_scrollLayer)
662 return; 662 return;
663 663
664 bool scrollingCoordinatorHandlesOffset = false; 664 bool scrollingCoordinatorHandlesOffset = false;
665 if (ScrollingCoordinator* scrollingCoordinator = 665 if (ScrollingCoordinator* scrollingCoordinator =
666 this->scrollingCoordinator()) { 666 this->scrollingCoordinator()) {
667 scrollingCoordinatorHandlesOffset = 667 scrollingCoordinatorHandlesOffset =
668 scrollingCoordinator->scrollableAreaScrollLayerDidChange(frameView); 668 scrollingCoordinator->scrollableAreaScrollLayerDidChange(frameView);
669 } 669 }
670 670
671 // Scroll position = scroll origin + scroll offset. Adjust the layer's 671 // Scroll position = scroll origin + scroll offset. Adjust the layer's
672 // position to handle whatever the scroll coordinator isn't handling. 672 // position to handle whatever the scroll coordinator isn't handling.
673 // The scroll origin is non-zero for RTL pages with overflow. 673 // The scroll origin is non-zero for RTL pages with overflow.
674 if (scrollingCoordinatorHandlesOffset) 674 if (scrollingCoordinatorHandlesOffset)
675 m_scrollLayer->setPosition(frameView->scrollOrigin()); 675 m_scrollLayer->setPosition(frameView->scrollOrigin());
676 else 676 else
677 m_scrollLayer->setPosition(-scrollPosition); 677 m_scrollLayer->setPosition(IntPoint(-scrollOffset));
678 678
679 DEFINE_STATIC_LOCAL(EnumerationHistogram, acceleratedBackgroundHistogram, 679 DEFINE_STATIC_LOCAL(EnumerationHistogram, acceleratedBackgroundHistogram,
680 ("Renderer.AcceleratedFixedRootBackground", 680 ("Renderer.AcceleratedFixedRootBackground",
681 AcceleratedFixedRootBackgroundHistogramMax)); 681 AcceleratedFixedRootBackgroundHistogramMax));
682 acceleratedBackgroundHistogram.count(ScrolledMainFrameBucket); 682 acceleratedBackgroundHistogram.count(ScrolledMainFrameBucket);
683 } 683 }
684 684
685 void PaintLayerCompositor::frameViewScrollbarsExistenceDidChange() { 685 void PaintLayerCompositor::frameViewScrollbarsExistenceDidChange() {
686 if (m_containerLayer) 686 if (m_containerLayer)
687 updateOverflowControlsLayers(); 687 updateOverflowControlsLayers();
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after
1346 } else if (graphicsLayer == m_scrollLayer.get()) { 1346 } else if (graphicsLayer == m_scrollLayer.get()) {
1347 name = "Frame Scrolling Layer"; 1347 name = "Frame Scrolling Layer";
1348 } else { 1348 } else {
1349 ASSERT_NOT_REACHED(); 1349 ASSERT_NOT_REACHED();
1350 } 1350 }
1351 1351
1352 return name; 1352 return name;
1353 } 1353 }
1354 1354
1355 } // namespace blink 1355 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698