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

Side by Side Diff: Source/core/page/scrolling/ScrollingCoordinator.cpp

Issue 22905004: Merge 154135 "Only set up scroll bar layers if we have created t..." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/1547/
Patch Set: Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 GraphicsLayer* scrollLayer = scrollLayerForScrollableArea(scrollableArea); 274 GraphicsLayer* scrollLayer = scrollLayerForScrollableArea(scrollableArea);
275 if (scrollLayer) 275 if (scrollLayer)
276 scrollLayer->setScrollableArea(scrollableArea); 276 scrollLayer->setScrollableArea(scrollableArea);
277 277
278 WebLayer* webLayer = scrollingWebLayerForScrollableArea(scrollableArea); 278 WebLayer* webLayer = scrollingWebLayerForScrollableArea(scrollableArea);
279 if (webLayer) { 279 if (webLayer) {
280 webLayer->setScrollable(true); 280 webLayer->setScrollable(true);
281 webLayer->setScrollPosition(IntPoint(scrollableArea->scrollPosition() - scrollableArea->minimumScrollPosition())); 281 webLayer->setScrollPosition(IntPoint(scrollableArea->scrollPosition() - scrollableArea->minimumScrollPosition()));
282 webLayer->setMaxScrollPosition(IntSize(scrollableArea->scrollSize(Horizo ntalScrollbar), scrollableArea->scrollSize(VerticalScrollbar))); 282 webLayer->setMaxScrollPosition(IntSize(scrollableArea->scrollSize(Horizo ntalScrollbar), scrollableArea->scrollSize(VerticalScrollbar)));
283 } 283 }
284 if (WebScrollbarLayer* scrollbarLayer = getWebScrollbarLayer(scrollableArea, HorizontalScrollbar)) 284 if (WebScrollbarLayer* scrollbarLayer = getWebScrollbarLayer(scrollableArea, HorizontalScrollbar)) {
285 setupScrollbarLayer(horizontalScrollbarLayerForScrollableArea(scrollable Area), scrollbarLayer, webLayer); 285 GraphicsLayer* horizontalScrollbarLayer = horizontalScrollbarLayerForScr ollableArea(scrollableArea);
286 if (WebScrollbarLayer* scrollbarLayer = getWebScrollbarLayer(scrollableArea, VerticalScrollbar)) 286 if (horizontalScrollbarLayer)
287 setupScrollbarLayer(verticalScrollbarLayerForScrollableArea(scrollableAr ea), scrollbarLayer, webLayer); 287 setupScrollbarLayer(horizontalScrollbarLayer, scrollbarLayer, webLay er);
288 }
289 if (WebScrollbarLayer* scrollbarLayer = getWebScrollbarLayer(scrollableArea, VerticalScrollbar)) {
290 GraphicsLayer* verticalScrollbarLayer = verticalScrollbarLayerForScrolla bleArea(scrollableArea);
291 if (verticalScrollbarLayer)
292 setupScrollbarLayer(verticalScrollbarLayer, scrollbarLayer, webLayer );
293 }
288 } 294 }
289 295
290 void ScrollingCoordinator::setTouchEventTargetRects(const Vector<IntRect>& absol uteHitTestRects) 296 void ScrollingCoordinator::setTouchEventTargetRects(const Vector<IntRect>& absol uteHitTestRects)
291 { 297 {
292 if (WebLayer* scrollLayer = scrollingWebLayerForScrollableArea(m_page->mainF rame()->view())) { 298 if (WebLayer* scrollLayer = scrollingWebLayerForScrollableArea(m_page->mainF rame()->view())) {
293 WebVector<WebRect> webRects(absoluteHitTestRects.size()); 299 WebVector<WebRect> webRects(absoluteHitTestRects.size());
294 for (size_t i = 0; i < absoluteHitTestRects.size(); ++i) 300 for (size_t i = 0; i < absoluteHitTestRects.size(); ++i)
295 webRects[i] = absoluteHitTestRects[i]; 301 webRects[i] = absoluteHitTestRects[i];
296 scrollLayer->setTouchEventHandlerRegion(webRects); 302 scrollLayer->setTouchEventHandlerRegion(webRects);
297 } 303 }
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 stringBuilder.resize(stringBuilder.length() - 2); 640 stringBuilder.resize(stringBuilder.length() - 2);
635 return stringBuilder.toString(); 641 return stringBuilder.toString();
636 } 642 }
637 643
638 String ScrollingCoordinator::mainThreadScrollingReasonsAsText() const 644 String ScrollingCoordinator::mainThreadScrollingReasonsAsText() const
639 { 645 {
640 return mainThreadScrollingReasonsAsText(mainThreadScrollingReasons()); 646 return mainThreadScrollingReasonsAsText(mainThreadScrollingReasons());
641 } 647 }
642 648
643 } // namespace WebCore 649 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698