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

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

Issue 22419002: Set up clip and scroll parents on the blink side. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: . 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 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 if (m_page->mainFrame()->view()->needsLayout()) 484 if (m_page->mainFrame()->view()->needsLayout())
485 return; 485 return;
486 486
487 TRACE_EVENT0("input", "ScrollingCoordinator::touchEventTargetRectsDidChange" ); 487 TRACE_EVENT0("input", "ScrollingCoordinator::touchEventTargetRectsDidChange" );
488 488
489 LayerHitTestRects touchEventTargetRects; 489 LayerHitTestRects touchEventTargetRects;
490 computeTouchEventTargetRects(touchEventTargetRects); 490 computeTouchEventTargetRects(touchEventTargetRects);
491 setTouchEventTargetRects(touchEventTargetRects); 491 setTouchEventTargetRects(touchEventTargetRects);
492 } 492 }
493 493
494 void ScrollingCoordinator::updateScrollParentForLayer(RenderLayer* child, Render Layer* parent)
495 {
496 if (!child || !child->backing())
497 return;
498
499 WebLayer* childWebLayer = scrollingWebLayerForGraphicsLayer(child->layerForS crollChild());
500 if (!childWebLayer)
501 return;
502
503 WebLayer* scrollParentWebLayer = 0;
504 if (parent && parent->backing())
505 scrollParentWebLayer = scrollingWebLayerForGraphicsLayer(parent->backing ()->parentForSublayers());
506
507 childWebLayer->setScrollParent(scrollParentWebLayer);
508 }
509
510 void ScrollingCoordinator::updateClipParentForLayer(RenderLayer* child, RenderLa yer* parent)
511 {
512 if (!child || !child->backing())
513 return;
514
515 WebLayer* childWebLayer = scrollingWebLayerForGraphicsLayer(child->backing() ->graphicsLayer());
516 if (!childWebLayer)
517 return;
518
519 WebLayer* clipParentWebLayer = 0;
520 if (parent && parent->backing())
521 clipParentWebLayer = scrollingWebLayerForGraphicsLayer(parent->backing() ->parentForSublayers());
522
523 childWebLayer->setClipParent(clipParentWebLayer);
524 }
525
494 void ScrollingCoordinator::willDestroyRenderLayer(RenderLayer* layer) 526 void ScrollingCoordinator::willDestroyRenderLayer(RenderLayer* layer)
495 { 527 {
496 m_layersWithTouchRects.remove(layer); 528 m_layersWithTouchRects.remove(layer);
497 } 529 }
498 530
499 void ScrollingCoordinator::setWheelEventHandlerCount(unsigned count) 531 void ScrollingCoordinator::setWheelEventHandlerCount(unsigned count)
500 { 532 {
501 if (WebLayer* scrollLayer = scrollingWebLayerForScrollableArea(m_page->mainF rame()->view())) 533 if (WebLayer* scrollLayer = scrollingWebLayerForScrollableArea(m_page->mainF rame()->view()))
502 scrollLayer->setHaveWheelEventHandlers(count > 0); 534 scrollLayer->setHaveWheelEventHandlers(count > 0);
503 } 535 }
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
808 stringBuilder.resize(stringBuilder.length() - 2); 840 stringBuilder.resize(stringBuilder.length() - 2);
809 return stringBuilder.toString(); 841 return stringBuilder.toString();
810 } 842 }
811 843
812 String ScrollingCoordinator::mainThreadScrollingReasonsAsText() const 844 String ScrollingCoordinator::mainThreadScrollingReasonsAsText() const
813 { 845 {
814 return mainThreadScrollingReasonsAsText(mainThreadScrollingReasons()); 846 return mainThreadScrollingReasonsAsText(mainThreadScrollingReasons());
815 } 847 }
816 848
817 } // namespace WebCore 849 } // 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