OLD | NEW |
---|---|
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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
281 scrollbarGraphicsLayer->setContentsOpaque(isMainFrame && isOpaqueScr ollbar); | 281 scrollbarGraphicsLayer->setContentsOpaque(isMainFrame && isOpaqueScr ollbar); |
282 scrollbarLayer->layer()->setOpaque(scrollbarGraphicsLayer->contentsOpaqu e()); | 282 scrollbarLayer->layer()->setOpaque(scrollbarGraphicsLayer->contentsOpaqu e()); |
283 | 283 |
284 setupScrollbarLayer(scrollbarGraphicsLayer, scrollbarLayer, scrollingWeb LayerForScrollableArea(scrollableArea)); | 284 setupScrollbarLayer(scrollbarGraphicsLayer, scrollbarLayer, scrollingWeb LayerForScrollableArea(scrollableArea)); |
285 } else | 285 } else |
286 removeWebScrollbarLayer(scrollableArea, orientation); | 286 removeWebScrollbarLayer(scrollableArea, orientation); |
287 } | 287 } |
288 | 288 |
289 bool ScrollingCoordinator::scrollableAreaScrollLayerDidChange(ScrollableArea* sc rollableArea) | 289 bool ScrollingCoordinator::scrollableAreaScrollLayerDidChange(ScrollableArea* sc rollableArea) |
290 { | 290 { |
291 TRACE_EVENT_INSTANT2("comp-scroll", "ScrollingCoordinator::scrollableAreaScr ollLayerDidChange", | |
292 "width", scrollableArea->scrollableAreaBoundingBox().width(), | |
293 "height", scrollableArea->scrollableAreaBoundingBox().height()); | |
294 | |
291 GraphicsLayer* scrollLayer = scrollLayerForScrollableArea(scrollableArea); | 295 GraphicsLayer* scrollLayer = scrollLayerForScrollableArea(scrollableArea); |
292 if (scrollLayer) { | 296 if (scrollLayer) { |
293 bool isMainFrame = isForMainFrame(scrollableArea); | 297 bool isMainFrame = isForMainFrame(scrollableArea); |
294 scrollLayer->setScrollableArea(scrollableArea, isMainFrame); | 298 scrollLayer->setScrollableArea(scrollableArea, isMainFrame); |
295 } | 299 } |
296 | 300 |
297 WebLayer* webLayer = scrollingWebLayerForScrollableArea(scrollableArea); | 301 WebLayer* webLayer = scrollingWebLayerForScrollableArea(scrollableArea); |
298 if (webLayer) { | 302 if (webLayer) { |
299 webLayer->setScrollable(true); | 303 webLayer->setScrollable(true); |
300 webLayer->setScrollPosition(IntPoint(scrollableArea->scrollPosition() - scrollableArea->minimumScrollPosition())); | 304 webLayer->setScrollPosition(IntPoint(scrollableArea->scrollPosition() - scrollableArea->minimumScrollPosition())); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
398 if (m_page->mainFrame()->view()->needsLayout()) | 402 if (m_page->mainFrame()->view()->needsLayout()) |
399 return; | 403 return; |
400 | 404 |
401 TRACE_EVENT0("input", "ScrollingCoordinator::touchEventTargetRectsDidChange" ); | 405 TRACE_EVENT0("input", "ScrollingCoordinator::touchEventTargetRectsDidChange" ); |
402 | 406 |
403 LayerHitTestRects touchEventTargetRects; | 407 LayerHitTestRects touchEventTargetRects; |
404 computeTouchEventTargetRects(touchEventTargetRects); | 408 computeTouchEventTargetRects(touchEventTargetRects); |
405 setTouchEventTargetRects(touchEventTargetRects); | 409 setTouchEventTargetRects(touchEventTargetRects); |
406 } | 410 } |
407 | 411 |
412 void ScrollingCoordinator::updateScrollParentForLayer(RenderLayer* child, Render Layer* parent) | |
413 { | |
414 if (!child || !child->backing()) | |
415 return; | |
416 | |
417 WebLayer* childWebLayer = scrollingWebLayerForGraphicsLayer(child->layerForS crollChild()); | |
418 if (!childWebLayer) | |
419 return; | |
420 | |
421 WebLayer* scrollParentWebLayer = 0; | |
422 if (parent && parent->backing()) | |
423 scrollParentWebLayer = scrollingWebLayerForGraphicsLayer(parent->backing ()->parentForSublayers()); | |
424 | |
425 TRACE_EVENT_INSTANT2("comp-scroll2", "ScrollingCoordinator::updateScrollPare ntForLayer", | |
enne (OOO)
2013/08/22 20:54:30
Would this trace event be better on the cc side wh
| |
426 "childId", childWebLayer->id(), | |
427 "ancestorId", scrollParentWebLayer ? scrollParentWebLayer->id() : -1); | |
enne (OOO)
2013/08/22 20:54:30
Ids start at 1, so you could say 0.
| |
428 | |
429 childWebLayer->setScrollParent(scrollParentWebLayer); | |
430 } | |
431 | |
432 void ScrollingCoordinator::updateClipParentForLayer(RenderLayer* child, RenderLa yer* parent) | |
433 { | |
434 if (!child || !child->backing()) | |
435 return; | |
436 | |
437 WebLayer* childWebLayer = scrollingWebLayerForGraphicsLayer(child->backing() ->graphicsLayer()); | |
438 if (!childWebLayer) | |
439 return; | |
440 | |
441 WebLayer* clipParentWebLayer = 0; | |
442 if (parent && parent->backing()) | |
443 clipParentWebLayer = scrollingWebLayerForGraphicsLayer(parent->backing() ->parentForSublayers()); | |
444 | |
445 TRACE_EVENT_INSTANT2("comp-scroll", "ScrollingCoordinator::updateClipParentF orLayer", | |
446 "childId", childWebLayer->id(), | |
447 "ancestorId", clipParentWebLayer ? clipParentWebLayer->id() : -1); | |
448 | |
449 childWebLayer->setClipParent(clipParentWebLayer); | |
450 } | |
451 | |
408 void ScrollingCoordinator::setWheelEventHandlerCount(unsigned count) | 452 void ScrollingCoordinator::setWheelEventHandlerCount(unsigned count) |
409 { | 453 { |
410 if (WebLayer* scrollLayer = scrollingWebLayerForScrollableArea(m_page->mainF rame()->view())) | 454 if (WebLayer* scrollLayer = scrollingWebLayerForScrollableArea(m_page->mainF rame()->view())) |
411 scrollLayer->setHaveWheelEventHandlers(count > 0); | 455 scrollLayer->setHaveWheelEventHandlers(count > 0); |
412 } | 456 } |
413 | 457 |
414 void ScrollingCoordinator::recomputeWheelEventHandlerCountForFrameView(FrameView * frameView) | 458 void ScrollingCoordinator::recomputeWheelEventHandlerCountForFrameView(FrameView * frameView) |
415 { | 459 { |
416 UNUSED_PARAM(frameView); | 460 UNUSED_PARAM(frameView); |
417 setWheelEventHandlerCount(computeCurrentWheelEventHandlerCount()); | 461 setWheelEventHandlerCount(computeCurrentWheelEventHandlerCount()); |
418 } | 462 } |
419 | 463 |
420 void ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread(MainTh readScrollingReasons reasons) | 464 void ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread(MainTh readScrollingReasons reasons) |
421 { | 465 { |
422 if (WebLayer* scrollLayer = scrollingWebLayerForScrollableArea(m_page->mainF rame()->view())) | 466 if (WebLayer* scrollLayer = scrollingWebLayerForScrollableArea(m_page->mainF rame()->view())) { |
467 TRACE_EVENT_INSTANT2("impl-scroll", "ScrollingCoordinator::setShouldUpda teScrollLayerPositionOnMainThread", | |
468 "layerId", scrollLayer->id(), | |
469 "reasons", reasons); | |
423 scrollLayer->setShouldScrollOnMainThread(reasons); | 470 scrollLayer->setShouldScrollOnMainThread(reasons); |
471 } | |
424 } | 472 } |
425 | 473 |
426 void ScrollingCoordinator::pageDestroyed() | 474 void ScrollingCoordinator::pageDestroyed() |
427 { | 475 { |
428 ASSERT(m_page); | 476 ASSERT(m_page); |
429 m_page = 0; | 477 m_page = 0; |
430 } | 478 } |
431 | 479 |
432 bool ScrollingCoordinator::coordinatesScrollingForFrameView(FrameView* frameView ) const | 480 bool ScrollingCoordinator::coordinatesScrollingForFrameView(FrameView* frameView ) const |
433 { | 481 { |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
728 stringBuilder.resize(stringBuilder.length() - 2); | 776 stringBuilder.resize(stringBuilder.length() - 2); |
729 return stringBuilder.toString(); | 777 return stringBuilder.toString(); |
730 } | 778 } |
731 | 779 |
732 String ScrollingCoordinator::mainThreadScrollingReasonsAsText() const | 780 String ScrollingCoordinator::mainThreadScrollingReasonsAsText() const |
733 { | 781 { |
734 return mainThreadScrollingReasonsAsText(mainThreadScrollingReasons()); | 782 return mainThreadScrollingReasonsAsText(mainThreadScrollingReasons()); |
735 } | 783 } |
736 | 784 |
737 } // namespace WebCore | 785 } // namespace WebCore |
OLD | NEW |