Changeset 152266 in webkit
- Timestamp:
- Jul 1, 2013 2:47:51 PM (11 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r152249 r152266 1 2013-07-01 Tim Horton <timothy_horton@apple.com> 2 3 [wk2] TiledCoreAnimationDrawingArea should support scrolling its exposed rect 4 https://bugs.webkit.org/show_bug.cgi?id=118173 5 <rdar://problem/14301166> 6 7 Reviewed by Anders Carlsson. 8 9 Offset the exposed rect passed from the WKView by the main frame's current scroll position 10 before sending it to our TiledBackings, so that it is in the same coordinate space as their 11 ordinary visibleRects. 12 13 This has the side effect of making clips-to-exposed-rect testable (though useless) in Safari. 14 15 * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: 16 Add updateScrolledExposedRect() and m_scrolledExposedRect. 17 18 * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: 19 (WebKit::TiledCoreAnimationDrawingArea::scroll): 20 Call updateScrolledExposedRect when the main frame scrolls. 21 22 (WebKit::TiledCoreAnimationDrawingArea::setExposedRect): 23 Remove a FIXME about this change. 24 Call updateScrolledExposedRect instead of passing down the unscrolled rect. 25 26 (WebKit::TiledCoreAnimationDrawingArea::setClipsToExposedRect): 27 Call updateScrolledExposedRect, because that method will short-circuit if 28 setClipsToExposedRect is false, so we need to update here for correctness 29 if we get a setExposedRect(), setClipsToExposedRect(true) pair. 30 31 (WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect): 32 Update m_scrolledExposedRect and propagate it to our TiledBackings. 33 34 (WebKit::TiledCoreAnimationDrawingArea::flushLayers): 35 (WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer): 36 (WebKit::TiledCoreAnimationDrawingArea::createPageOverlayLayer): 37 (WebKit::TiledCoreAnimationDrawingArea::didCommitChangesForLayer): 38 Use the scrolled exposed rect. 39 1 40 2013-07-01 Ada Chan <adachan@apple.com> 2 41 -
trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h
r152190 r152266 112 112 void updateIntrinsicContentSizeTimerFired(WebCore::Timer<TiledCoreAnimationDrawingArea>*); 113 113 void updateMainFrameClipsToExposedRect(); 114 void updateScrolledExposedRect(); 114 115 115 116 void invalidateAllPageOverlays(); … … 133 134 134 135 WebCore::FloatRect m_exposedRect; 136 WebCore::FloatRect m_scrolledExposedRect; 135 137 bool m_clipsToExposedRect; 136 138 -
trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm
r152190 r152266 113 113 void TiledCoreAnimationDrawingArea::scroll(const IntRect& scrollRect, const IntSize& scrollDelta) 114 114 { 115 updateScrolledExposedRect(); 115 116 } 116 117 … … 352 353 IntRect visibleRect = enclosingIntRect(m_rootLayer.get().frame); 353 354 if (m_clipsToExposedRect) 354 visibleRect.intersect(enclosingIntRect(m_ exposedRect));355 visibleRect.intersect(enclosingIntRect(m_scrolledExposedRect)); 355 356 356 357 for (PageOverlayLayerMap::iterator it = m_pageOverlayLayers.begin(), end = m_pageOverlayLayers.end(); it != end; ++it) { … … 405 406 void TiledCoreAnimationDrawingArea::setExposedRect(const FloatRect& exposedRect) 406 407 { 407 // FIXME: This should be mapped through the scroll offset, but we need to keep it up to date.408 408 m_exposedRect = exposedRect; 409 410 mainFrameTiledBacking()->setExposedRect(exposedRect); 411 412 for (PageOverlayLayerMap::iterator it = m_pageOverlayLayers.begin(), end = m_pageOverlayLayers.end(); it != end; ++it) 409 updateScrolledExposedRect(); 410 } 411 412 void TiledCoreAnimationDrawingArea::setClipsToExposedRect(bool clipsToExposedRect) 413 { 414 m_clipsToExposedRect = clipsToExposedRect; 415 updateScrolledExposedRect(); 416 updateMainFrameClipsToExposedRect(); 417 } 418 419 void TiledCoreAnimationDrawingArea::updateScrolledExposedRect() 420 { 421 if (!m_clipsToExposedRect) 422 return; 423 424 Frame* frame = m_webPage->corePage()->mainFrame(); 425 if (!frame) 426 return; 427 428 FrameView* frameView = frame->view(); 429 if (!frameView) 430 return; 431 432 IntPoint scrollPositionWithOrigin = frameView->scrollPosition() + toIntSize(frameView->scrollOrigin()); 433 434 m_scrolledExposedRect = m_exposedRect; 435 m_scrolledExposedRect.moveBy(scrollPositionWithOrigin); 436 437 mainFrameTiledBacking()->setExposedRect(m_scrolledExposedRect); 438 439 for (PageOverlayLayerMap::iterator it = m_pageOverlayLayers.begin(), end = m_pageOverlayLayers.end(); it != end; ++it) { 413 440 if (TiledBacking* tiledBacking = it->value->tiledBacking()) 414 tiledBacking->setExposedRect(exposedRect); 415 } 416 417 void TiledCoreAnimationDrawingArea::setClipsToExposedRect(bool clipsToExposedRect) 418 { 419 m_clipsToExposedRect = clipsToExposedRect; 420 updateMainFrameClipsToExposedRect(); 441 tiledBacking->setExposedRect(m_scrolledExposedRect); 442 } 421 443 } 422 444 … … 566 588 if (TiledBacking* tiledBacking = mainFrameTiledBacking()) { 567 589 tiledBacking->setAggressivelyRetainsTiles(m_webPage->corePage()->settings()->aggressiveTileRetentionEnabled()); 568 tiledBacking->setExposedRect(m_ exposedRect);590 tiledBacking->setExposedRect(m_scrolledExposedRect); 569 591 } 570 592 … … 590 612 591 613 if (TiledBacking* tiledBacking = layer->tiledBacking()) { 592 tiledBacking->setExposedRect(m_ exposedRect);614 tiledBacking->setExposedRect(m_scrolledExposedRect); 593 615 tiledBacking->setClipsToExposedRect(m_clipsToExposedRect); 594 616 } … … 638 660 639 661 if (TiledBacking* tiledBacking = layer->tiledBacking()) { 640 tiledBacking->setExposedRect(m_ exposedRect);662 tiledBacking->setExposedRect(m_scrolledExposedRect); 641 663 tiledBacking->setClipsToExposedRect(m_clipsToExposedRect); 642 664 }
Note: See TracChangeset
for help on using the changeset viewer.