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

Side by Side Diff: third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.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) 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2011 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 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 if (scrollLayer) { 480 if (scrollLayer) {
481 bool isForVisualViewport = 481 bool isForVisualViewport =
482 scrollableArea == &m_page->frameHost().visualViewport(); 482 scrollableArea == &m_page->frameHost().visualViewport();
483 scrollLayer->setScrollableArea(scrollableArea, isForVisualViewport); 483 scrollLayer->setScrollableArea(scrollableArea, isForVisualViewport);
484 } 484 }
485 485
486 WebLayer* webLayer = toWebLayer(scrollableArea->layerForScrolling()); 486 WebLayer* webLayer = toWebLayer(scrollableArea->layerForScrolling());
487 WebLayer* containerLayer = toWebLayer(scrollableArea->layerForContainer()); 487 WebLayer* containerLayer = toWebLayer(scrollableArea->layerForContainer());
488 if (webLayer) { 488 if (webLayer) {
489 webLayer->setScrollClipLayer(containerLayer); 489 webLayer->setScrollClipLayer(containerLayer);
490 DoublePoint scrollPosition(FloatPoint(scrollableArea->scrollOrigin()) + 490 FloatPoint scrollPosition(scrollableArea->scrollOrigin() +
491 scrollableArea->getScrollOffset()); 491 scrollableArea->getScrollOffset());
492 webLayer->setScrollPositionDouble(scrollPosition); 492 webLayer->setScrollPosition(scrollPosition);
493 493
494 webLayer->setBounds(scrollableArea->contentsSize()); 494 webLayer->setBounds(scrollableArea->contentsSize());
495 bool canScrollX = scrollableArea->userInputScrollable(HorizontalScrollbar); 495 bool canScrollX = scrollableArea->userInputScrollable(HorizontalScrollbar);
496 bool canScrollY = scrollableArea->userInputScrollable(VerticalScrollbar); 496 bool canScrollY = scrollableArea->userInputScrollable(VerticalScrollbar);
497 webLayer->setUserScrollable(canScrollX, canScrollY); 497 webLayer->setUserScrollable(canScrollX, canScrollY);
498 } 498 }
499 if (WebScrollbarLayer* scrollbarLayer = 499 if (WebScrollbarLayer* scrollbarLayer =
500 getWebScrollbarLayer(scrollableArea, HorizontalScrollbar)) { 500 getWebScrollbarLayer(scrollableArea, HorizontalScrollbar)) {
501 GraphicsLayer* horizontalScrollbarLayer = 501 GraphicsLayer* horizontalScrollbarLayer =
502 scrollableArea->layerForHorizontalScrollbar(); 502 scrollableArea->layerForHorizontalScrollbar();
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after
1188 frameView ? toWebLayer(frameView->layoutViewportScrollableArea() 1188 frameView ? toWebLayer(frameView->layoutViewportScrollableArea()
1189 ->layerForScrolling()) 1189 ->layerForScrolling())
1190 : nullptr) { 1190 : nullptr) {
1191 return WebSize(frameView->layoutViewportScrollableArea()->contentsSize()) != 1191 return WebSize(frameView->layoutViewportScrollableArea()->contentsSize()) !=
1192 scrollLayer->bounds(); 1192 scrollLayer->bounds();
1193 } 1193 }
1194 return false; 1194 return false;
1195 } 1195 }
1196 1196
1197 } // namespace blink 1197 } // namespace blink
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_unittest_scroll.cc ('k') | third_party/WebKit/Source/platform/graphics/GraphicsLayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698