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

Side by Side Diff: third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp

Issue 2680953002: Remove GraphicsLayer::didScroll and directly call ScrollableArea::didScroll (Closed)
Patch Set: Incorporate reviewer comments: more tests, less bad tests Created 3 years, 10 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) 2010, Google Inc. All rights reserved. 2 * Copyright (c) 2010, Google Inc. All rights reserved.
3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved. 3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 FloatQuad result(quad); 655 FloatQuad result(quad);
656 result.move(-getScrollOffset()); 656 result.move(-getScrollOffset());
657 return result; 657 return result;
658 } 658 }
659 659
660 IntSize ScrollableArea::excludeScrollbars(const IntSize& size) const { 660 IntSize ScrollableArea::excludeScrollbars(const IntSize& size) const {
661 return IntSize(std::max(0, size.width() - verticalScrollbarWidth()), 661 return IntSize(std::max(0, size.width() - verticalScrollbarWidth()),
662 std::max(0, size.height() - horizontalScrollbarHeight())); 662 std::max(0, size.height() - horizontalScrollbarHeight()));
663 } 663 }
664 664
665 void ScrollableArea::didScroll(const gfx::ScrollOffset& offset) {
666 ScrollOffset newOffset = ScrollOffset(offset.x() - scrollOrigin().x(),
667 offset.y() - scrollOrigin().y());
668 setScrollOffset(newOffset, CompositorScroll);
669 }
670
665 DEFINE_TRACE(ScrollableArea) { 671 DEFINE_TRACE(ScrollableArea) {
666 visitor->trace(m_scrollAnimator); 672 visitor->trace(m_scrollAnimator);
667 visitor->trace(m_programmaticScrollAnimator); 673 visitor->trace(m_programmaticScrollAnimator);
668 } 674 }
669 675
670 } // namespace blink 676 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698