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

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

Issue 23903012: Set up scroll and clip parents (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Make WebLayer additions pure virtual. Created 7 years, 3 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 | « Source/core/page/scrolling/ScrollingCoordinator.h ('k') | Source/core/rendering/RenderLayer.h » ('j') | 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 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 if (m_page->mainFrame()->view()->needsLayout()) 504 if (m_page->mainFrame()->view()->needsLayout())
505 return; 505 return;
506 506
507 TRACE_EVENT0("input", "ScrollingCoordinator::touchEventTargetRectsDidChange" ); 507 TRACE_EVENT0("input", "ScrollingCoordinator::touchEventTargetRectsDidChange" );
508 508
509 LayerHitTestRects touchEventTargetRects; 509 LayerHitTestRects touchEventTargetRects;
510 computeTouchEventTargetRects(touchEventTargetRects); 510 computeTouchEventTargetRects(touchEventTargetRects);
511 setTouchEventTargetRects(touchEventTargetRects); 511 setTouchEventTargetRects(touchEventTargetRects);
512 } 512 }
513 513
514 void ScrollingCoordinator::updateScrollParentForLayer(RenderLayer* child, Render Layer* parent)
515 {
516 WebLayer* childWebLayer = scrollingWebLayerForGraphicsLayer(child->layerForS crollChild());
517 if (!childWebLayer)
518 return;
519
520 WebLayer* scrollParentWebLayer = 0;
521 if (parent && parent->backing())
522 scrollParentWebLayer = scrollingWebLayerForGraphicsLayer(parent->backing ()->parentForSublayers());
523
524 childWebLayer->setScrollParent(scrollParentWebLayer);
525 }
526
527 void ScrollingCoordinator::updateClipParentForLayer(RenderLayer* child, RenderLa yer* parent)
528 {
529 WebLayer* childWebLayer = scrollingWebLayerForGraphicsLayer(child->backing() ->graphicsLayer());
530 if (!childWebLayer)
531 return;
532
533 WebLayer* clipParentWebLayer = 0;
534 if (parent && parent->backing())
535 clipParentWebLayer = scrollingWebLayerForGraphicsLayer(parent->backing() ->parentForSublayers());
536
537 childWebLayer->setClipParent(clipParentWebLayer);
538 }
539
514 void ScrollingCoordinator::willDestroyRenderLayer(RenderLayer* layer) 540 void ScrollingCoordinator::willDestroyRenderLayer(RenderLayer* layer)
515 { 541 {
516 m_layersWithTouchRects.remove(layer); 542 m_layersWithTouchRects.remove(layer);
517 } 543 }
518 544
519 void ScrollingCoordinator::setWheelEventHandlerCount(unsigned count) 545 void ScrollingCoordinator::setWheelEventHandlerCount(unsigned count)
520 { 546 {
521 if (WebLayer* scrollLayer = scrollingWebLayerForScrollableArea(m_page->mainF rame()->view())) 547 if (WebLayer* scrollLayer = scrollingWebLayerForScrollableArea(m_page->mainF rame()->view()))
522 scrollLayer->setHaveWheelEventHandlers(count > 0); 548 scrollLayer->setHaveWheelEventHandlers(count > 0);
523 } 549 }
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 stringBuilder.resize(stringBuilder.length() - 2); 854 stringBuilder.resize(stringBuilder.length() - 2);
829 return stringBuilder.toString(); 855 return stringBuilder.toString();
830 } 856 }
831 857
832 String ScrollingCoordinator::mainThreadScrollingReasonsAsText() const 858 String ScrollingCoordinator::mainThreadScrollingReasonsAsText() const
833 { 859 {
834 return mainThreadScrollingReasonsAsText(mainThreadScrollingReasons()); 860 return mainThreadScrollingReasonsAsText(mainThreadScrollingReasons());
835 } 861 }
836 862
837 } // namespace WebCore 863 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/page/scrolling/ScrollingCoordinator.h ('k') | Source/core/rendering/RenderLayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698