Changeset 161530 in webkit
- Timestamp:
- Jan 8, 2014 5:38:13 PM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r161521 r161530 1 2014-01-08 Tim Horton <timothy_horton@apple.com> 2 3 TileController can fail to receive exposedRect from the drawing area if set at the wrong time 4 https://bugs.webkit.org/show_bug.cgi?id=126536 5 6 Reviewed by Simon Fraser. 7 8 * WebCore.exp.in: 9 Export some things. 10 11 * page/FrameView.cpp: 12 (WebCore::FrameView::FrameView): 13 (WebCore::FrameView::setExposedRect): 14 Store the exposed rect on FrameView. When it changes, if the main frame 15 has a TiledBacking, inform it of the change. 16 17 * page/FrameView.h: 18 * platform/graphics/TiledBacking.h: 19 * platform/graphics/ca/mac/TileController.h: 20 * platform/graphics/ca/mac/TileController.mm: 21 (WebCore::TileController::TileController): 22 (WebCore::TileController::tilesWouldChangeForVisibleRect): 23 (WebCore::TileController::computeTileCoverageRect): 24 (WebCore::TileController::revalidateTiles): 25 (WebCore::TileController::updateTileCoverageMap): 26 Make use of the fact that we can test if a rect is infinite 27 instead of having a separate boolean property for that. 28 29 * rendering/RenderLayerBacking.cpp: 30 (WebCore::RenderLayerBacking::RenderLayerBacking): 31 (WebCore::computeTileCoverage): 32 Push the FrameView's cached exposed rect down into the TiledBacking when it is created. 33 We only support clipping for the main frame TileController for now. 34 1 35 2014-01-07 Myles C. Maxfield <mmaxfield@apple.com> 2 36 -
trunk/Source/WebCore/WebCore.exp.in
r161481 r161530 1269 1269 __ZN7WebCore9FrameView14adjustViewSizeEv 1270 1270 __ZN7WebCore9FrameView14invalidateRectERKNS_7IntRectE 1271 __ZN7WebCore9FrameView14setExposedRectENS_9FloatRectE 1271 1272 __ZN7WebCore9FrameView14setNeedsLayoutEv 1272 1273 __ZN7WebCore9FrameView14setTransparentEb … … 1860 1861 __ZThn???_NK7WebCore15GraphicsLayerCA33platformCALayerShowRepaintCounterEPNS_15PlatformCALayerE 1861 1862 __ZThn???_NK7WebCore15GraphicsLayerCA49platformCALayerContentsScaleMultiplierForNewTilesEPNS_15PlatformCALayerE 1863 __ZThn???_NK7WebCore15GraphicsLayerCA26platformCALayerExposedRectEv 1862 1864 _filenameByFixingIllegalCharacters 1863 1865 _hasCaseInsensitivePrefix -
trunk/Source/WebCore/page/FrameView.cpp
r161452 r161530 202 202 , m_isTrackingRepaints(false) 203 203 , m_shouldUpdateWhileOffscreen(true) 204 , m_exposedRect(FloatRect::infiniteRect()) 204 205 , m_deferSetNeedsLayouts(0) 205 206 , m_setNeedsLayoutWasDeferred(false) … … 4372 4373 } 4373 4374 4375 void FrameView::setExposedRect(FloatRect exposedRect) 4376 { 4377 if (m_exposedRect == exposedRect) 4378 return; 4379 4380 m_exposedRect = exposedRect; 4381 4382 #if USE(ACCELERATED_COMPOSITING) 4383 // FIXME: We should support clipping to the exposed rect for subframes as well. 4384 if (m_frame->isMainFrame()) { 4385 if (TiledBacking* tiledBacking = this->tiledBacking()) 4386 tiledBacking->setExposedRect(exposedRect); 4387 } 4388 #endif 4389 } 4390 4374 4391 } // namespace WebCore -
trunk/Source/WebCore/page/FrameView.h
r161452 r161530 446 446 void addTrackedRepaintRect(const IntRect&); 447 447 448 // exposedRect represents WebKit's understanding of what part 449 // of the view is actually exposed on screen (taking into account 450 // clipping by other UI elements), whereas visibleContentRect is 451 // internal to WebCore and doesn't respect those things. 452 void setExposedRect(FloatRect); 453 FloatRect exposedRect() const { return m_exposedRect; } 454 448 455 protected: 449 456 virtual bool scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect) OVERRIDE; … … 631 638 bool m_shouldUpdateWhileOffscreen; 632 639 640 FloatRect m_exposedRect; 641 633 642 unsigned m_deferSetNeedsLayouts; 634 643 bool m_setNeedsLayoutWasDeferred; -
trunk/Source/WebCore/platform/graphics/TiledBacking.h
r161452 r161530 49 49 50 50 virtual void setExposedRect(const FloatRect&) = 0; 51 virtual void setClipsToExposedRect(bool) = 0;52 virtual bool clipsToExposedRect() = 0;53 51 54 52 virtual void prepopulateRect(const FloatRect&) = 0; -
trunk/Source/WebCore/platform/graphics/ca/mac/TileController.h
r161452 r161530 104 104 virtual bool tilesWouldChangeForVisibleRect(const FloatRect&) const OVERRIDE; 105 105 virtual void setExposedRect(const FloatRect&) OVERRIDE; 106 virtual bool clipsToExposedRect() OVERRIDE { return m_clipsToExposedRect; }107 virtual void setClipsToExposedRect(bool) OVERRIDE;108 106 virtual void prepopulateRect(const FloatRect&) OVERRIDE; 109 107 virtual void setIsInWindow(bool) OVERRIDE; … … 246 244 bool m_acceleratesDrawing; 247 245 bool m_tilesAreOpaque; 248 bool m_clipsToExposedRect;249 246 bool m_hasTilesWithTemporaryScaleFactor; // Used to make low-res tiles when zooming. 250 247 -
trunk/Source/WebCore/platform/graphics/ca/mac/TileController.mm
r161452 r161530 53 53 : m_tileCacheLayer(rootPlatformLayer) 54 54 , m_tileSize(defaultTileWidth, defaultTileHeight) 55 , m_exposedRect(FloatRect::infiniteRect()) 55 56 , m_tileRevalidationTimer(this, &TileController::tileRevalidationTimerFired) 56 57 , m_cohortRemovalTimer(this, &TileController::cohortRemovalTimerFired) … … 68 69 , m_acceleratesDrawing(false) 69 70 , m_tilesAreOpaque(false) 70 , m_clipsToExposedRect(false)71 71 , m_hasTilesWithTemporaryScaleFactor(false) 72 72 , m_tileDebugBorderWidth(0) … … 278 278 { 279 279 FloatRect visibleRect = newVisibleRect; 280 281 if (m_clipsToExposedRect) 282 visibleRect.intersect(m_exposedRect); 280 visibleRect.intersect(m_exposedRect); 283 281 284 282 if (visibleRect.isEmpty() || bounds().isEmpty()) … … 313 311 } 314 312 315 void TileController::setClipsToExposedRect(bool clipsToExposedRect)316 {317 if (m_clipsToExposedRect == clipsToExposedRect)318 return;319 320 m_clipsToExposedRect = clipsToExposedRect;321 322 // Going from not clipping to clipping, we don't need to revalidate right away.323 if (clipsToExposedRect)324 setNeedsRevalidateTiles();325 }326 327 313 void TileController::prepopulateRect(const FloatRect& rect) 328 314 { … … 488 474 { 489 475 FloatRect visibleRect = currentVisibleRect; 490 491 if (m_clipsToExposedRect) 492 visibleRect.intersect(m_exposedRect); 476 visibleRect.intersect(m_exposedRect); 493 477 494 478 // If the page is not in a window (for example if it's in a background tab), we limit the tile coverage rect to the visible rect. … … 689 673 IntRect bounds = this->bounds(); 690 674 691 if (m_clipsToExposedRect) 692 visibleRect.intersect(m_exposedRect); 675 visibleRect.intersect(m_exposedRect); 693 676 694 677 if (visibleRect.isEmpty() || bounds.isEmpty()) … … 933 916 FloatRect visibleRect = this->visibleRect(); 934 917 935 if (m_clipsToExposedRect) 936 visibleRect.intersect(m_exposedRect); 937 918 visibleRect.intersect(m_exposedRect); 938 919 visibleRect.contract(4, 4); // Layer is positioned 2px from top and left edges. 939 920 … … 949 930 mapBounds.scale(indicatorScale, indicatorScale); 950 931 951 if ( m_clipsToExposedRect)932 if (!m_exposedRect.isInfinite()) 952 933 m_tiledScrollingIndicatorLayer->setPosition(m_exposedRect.location() + FloatPoint(2, 2)); 953 934 else -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r161452 r161530 143 143 144 144 if (m_isMainFrameRenderViewLayer) { 145 tiledBacking->setExposedRect(renderer().frame().view()->exposedRect()); 145 146 tiledBacking->setUnparentsOffscreenTiles(true); 146 147 if (page->settings().backgroundShouldExtendBeyondPage()) … … 229 230 } 230 231 if (!(useMinimalTilesDuringLoading || useMinimalTilesDuringLiveResize)) { 231 bool clipsToExposedRect = backing->tiledBacking()->clipsToExposedRect();232 bool clipsToExposedRect = !frameView.exposedRect().isInfinite(); 232 233 if (frameView.horizontalScrollbarMode() != ScrollbarAlwaysOff || clipsToExposedRect) 233 234 tileCoverage |= TiledBacking::CoverageForHorizontalScrolling; -
trunk/Source/WebKit2/ChangeLog
r161529 r161530 1 2014-01-08 Tim Horton <timothy_horton@apple.com> 2 3 TileController can fail to receive exposedRect from the drawing area if set at the wrong time 4 https://bugs.webkit.org/show_bug.cgi?id=126536 5 6 Reviewed by Simon Fraser. 7 8 * Configurations/WebKit2.xcconfig: 9 * UIProcess/API/mac/WKView.mm: 10 (-[WKView _updateViewExposedRect]): 11 * UIProcess/DrawingAreaProxy.cpp: 12 (WebKit::DrawingAreaProxy::DrawingAreaProxy): 13 (WebKit::DrawingAreaProxy::setExposedRect): 14 (WebKit::DrawingAreaProxy::exposedRectChangedTimerFired): 15 * UIProcess/DrawingAreaProxy.h: 16 (WebKit::DrawingAreaProxy::exposedRect): 17 * UIProcess/WebPageProxy.cpp: 18 (WebKit::WebPageProxy::WebPageProxy): 19 (WebKit::WebPageProxy::close): 20 * UIProcess/WebPageProxy.h: 21 Move exposedRect stuff from WebPageProxy to DrawingAreaProxy. 22 23 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: 24 (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): 25 Push the exposedRect down into WebCore. 26 27 * WebProcess/WebPage/DrawingArea.h: 28 * WebProcess/WebPage/DrawingArea.messages.in: 29 * WebProcess/WebPage/WebPage.cpp: 30 * WebProcess/WebPage/WebPage.h: 31 * WebProcess/WebPage/WebPage.messages.in: 32 * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: 33 * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: 34 (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea): 35 (WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect): 36 * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: 37 * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: 38 (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea): 39 (WebKit::TiledCoreAnimationDrawingArea::flushLayers): 40 (WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect): 41 (WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer): 42 (WebKit::TiledCoreAnimationDrawingArea::createPageOverlayLayer): 43 (WebKit::TiledCoreAnimationDrawingArea::didCommitChangesForLayer): 44 Get rid of "clipsToExposedRect", we just use infinite-ness of the rect 45 to indicate that now. 46 Don't scroll an infinite rect; it won't work. 47 1 48 2014-01-08 Simon Fraser <simon.fraser@apple.com> 2 49 -
trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm
r161452 r161530 391 391 exposedRect = NSUnionRect(_data->_contentPreparationRect, exposedRect); 392 392 393 _data->_page-> viewExposedRectChanged(exposedRect, _data->_clipsToVisibleRect ? WebPageProxy::ClipsToExposedRect::Clip : WebPageProxy::ClipsToExposedRect::DoNotClip);393 _data->_page->drawingArea()->setExposedRect(_data->_clipsToVisibleRect ? FloatRect(exposedRect) : FloatRect::infiniteRect()); 394 394 } 395 395 -
trunk/Source/WebKit2/UIProcess/DrawingAreaProxy.cpp
r161452 r161530 27 27 #include "DrawingAreaProxy.h" 28 28 29 #include "DrawingAreaMessages.h" 29 30 #include "DrawingAreaProxyMessages.h" 30 31 #include "WebPageProxy.h" … … 39 40 , m_webPageProxy(webPageProxy) 40 41 , m_size(webPageProxy->viewSize()) 42 #if PLATFORM(MAC) 43 , m_exposedRectChangedTimer(this, &DrawingAreaProxy::exposedRectChangedTimerFired) 44 #endif 41 45 { 42 46 m_webPageProxy->process().addMessageReceiver(Messages::DrawingAreaProxy::messageReceiverName(), webPageProxy->pageID(), *this); … … 59 63 } 60 64 65 #if PLATFORM(MAC) 66 void DrawingAreaProxy::setExposedRect(const FloatRect& exposedRect) 67 { 68 if (!m_webPageProxy->isValid()) 69 return; 70 71 m_exposedRect = exposedRect; 72 73 if (!m_exposedRectChangedTimer.isActive()) 74 m_exposedRectChangedTimer.startOneShot(0); 75 } 76 77 void DrawingAreaProxy::exposedRectChangedTimerFired(Timer<DrawingAreaProxy>*) 78 { 79 if (!m_webPageProxy->isValid()) 80 return; 81 82 if (m_exposedRect == m_lastSentExposedRect) 83 return; 84 85 m_webPageProxy->process().send(Messages::DrawingArea::SetExposedRect(m_exposedRect), m_webPageProxy->pageID()); 86 m_lastSentExposedRect = m_exposedRect; 87 } 88 #endif 89 61 90 } // namespace WebKit -
trunk/Source/WebKit2/UIProcess/DrawingAreaProxy.h
r161474 r161530 30 30 #include "DrawingAreaInfo.h" 31 31 #include "MessageReceiver.h" 32 #include <WebCore/Float Point.h>32 #include <WebCore/FloatRect.h> 33 33 #include <WebCore/IntRect.h> 34 34 #include <WebCore/IntSize.h> 35 #include <WebCore/Timer.h> 35 36 #include <chrono> 36 37 #include <stdint.h> … … 73 74 virtual void commitTransientZoom(double, WebCore::FloatPoint) { } 74 75 76 #if PLATFORM(MAC) 77 void setExposedRect(const WebCore::FloatRect&); 78 WebCore::FloatRect exposedRect() const { return m_exposedRect; } 79 void exposedRectChangedTimerFired(WebCore::Timer<DrawingAreaProxy>*); 80 #endif 81 75 82 protected: 76 83 explicit DrawingAreaProxy(DrawingAreaType, WebPageProxy*); … … 101 108 virtual void didUpdateGeometry() { } 102 109 virtual void intrinsicContentSizeDidChange(const WebCore::IntSize& newIntrinsicContentSize) { } 110 111 WebCore::Timer<DrawingAreaProxy> m_exposedRectChangedTimer; 112 WebCore::FloatRect m_exposedRect; 113 WebCore::FloatRect m_lastSentExposedRect; 103 114 #endif 104 115 }; -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r161452 r161530 309 309 , m_mayStartMediaWhenInWindow(true) 310 310 , m_waitingForDidUpdateViewState(false) 311 #if PLATFORM(MAC)312 , m_exposedRectChangedTimer(this, &WebPageProxy::exposedRectChangedTimerFired)313 , m_clipsToExposedRect(ClipsToExposedRect::DoNotClip)314 , m_lastSentClipsToExposedRect(ClipsToExposedRect::DoNotClip)315 #endif316 311 , m_scrollPinningBehavior(DoNotPin) 317 312 { … … 561 556 #if ENABLE(CONTEXT_MENUS) 562 557 m_contextMenuClient.initialize(0); 563 #endif564 565 #if PLATFORM(MAC) && !PLATFORM(IOS)566 m_exposedRectChangedTimer.stop();567 558 #endif 568 559 … … 4421 4412 } 4422 4413 4423 #if PLATFORM(MAC) || PLATFORM(IOS)4424 void WebPageProxy::viewExposedRectChanged(const FloatRect& exposedRect, ClipsToExposedRect clipsToExposedRect)4425 {4426 if (!isValid())4427 return;4428 4429 m_exposedRect = exposedRect;4430 m_clipsToExposedRect = clipsToExposedRect;4431 4432 if (!m_exposedRectChangedTimer.isActive())4433 m_exposedRectChangedTimer.startOneShot(0);4434 }4435 4436 void WebPageProxy::exposedRectChangedTimerFired(Timer<WebPageProxy>*)4437 {4438 if (!isValid())4439 return;4440 4441 if (m_exposedRect == m_lastSentExposedRect && m_clipsToExposedRect == m_lastSentClipsToExposedRect)4442 return;4443 4444 process().send(Messages::WebPage::ViewExposedRectChanged(m_exposedRect, m_clipsToExposedRect == ClipsToExposedRect::Clip), m_pageID);4445 m_lastSentExposedRect = m_exposedRect;4446 m_lastSentClipsToExposedRect = m_clipsToExposedRect;4447 }4448 #endif4449 4450 4414 } // namespace WebKit -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r161452 r161530 473 473 #if PLATFORM(MAC) 474 474 void windowAndViewFramesChanged(const WebCore::FloatRect& viewFrameInWindowCoordinates, const WebCore::FloatPoint& accessibilityViewCoordinates); 475 enum class ClipsToExposedRect { DoNotClip, Clip };476 void viewExposedRectChanged(const WebCore::FloatRect& exposedRect, ClipsToExposedRect);477 WebCore::FloatRect viewExposedRect() const { return m_exposedRect; }478 void exposedRectChangedTimerFired(WebCore::Timer<WebPageProxy>*);479 475 void setMainFrameIsScrollable(bool); 480 476 … … 1375 1371 1376 1372 #if PLATFORM(MAC) 1377 WebCore::Timer<WebPageProxy> m_exposedRectChangedTimer;1378 WebCore::FloatRect m_exposedRect;1379 WebCore::FloatRect m_lastSentExposedRect;1380 ClipsToExposedRect m_clipsToExposedRect;1381 ClipsToExposedRect m_lastSentClipsToExposedRect;1382 #endif1383 1384 #if PLATFORM(MAC)1385 1373 HashMap<String, String> m_temporaryPDFFiles; 1386 1374 #endif -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
r161452 r161530 1239 1239 m_frame->coreFrame()->view()->setProhibitsScrolling(shouldDisableScrolling); 1240 1240 m_frame->coreFrame()->view()->setVisualUpdatesAllowedByClient(!webPage->shouldExtendIncrementalRenderingSuppression()); 1241 m_frame->coreFrame()->view()->setExposedRect(webPage->drawingArea()->exposedRect()); 1241 1242 #if PLATFORM(IOS) 1242 1243 m_frame->coreFrame()->view()->setDelegatesScrolling(true); -
trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h
r161452 r161530 29 29 #include "DrawingAreaInfo.h" 30 30 #include "LayerTreeContext.h" 31 #include <WebCore/Float Point.h>31 #include <WebCore/FloatRect.h> 32 32 #include <WebCore/IntRect.h> 33 33 #include <WebCore/ViewState.h> … … 87 87 virtual void mainFrameContentSizeChanged(const WebCore::IntSize&) { } 88 88 89 virtual void setExposedRect(const WebCore::FloatRect&) { }90 virtual void setClipsToExposedRect(bool) { }89 virtual void setExposedRect(const WebCore::FloatRect&) = 0; 90 virtual WebCore::FloatRect exposedRect() const = 0; 91 91 virtual void mainFrameScrollabilityChanged(bool) { } 92 92 -
trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.messages.in
r161452 r161530 30 30 SetDeviceScaleFactor(float deviceScaleFactor) 31 31 SetColorSpace(WebKit::ColorSpaceData colorSpace) 32 32 SetExposedRect(WebCore::FloatRect exposedRect) 33 33 34 AdjustTransientZoom(double scale, WebCore::FloatPoint origin) 34 35 CommitTransientZoom(double scale, WebCore::FloatPoint origin) -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r161452 r161530 3076 3076 #endif 3077 3077 3078 void WebPage::viewExposedRectChanged(const FloatRect& exposedRect, bool clipsToExposedRect)3079 {3080 m_drawingArea->setExposedRect(exposedRect);3081 m_drawingArea->setClipsToExposedRect(clipsToExposedRect);3082 }3083 3084 3078 void WebPage::setMainFrameIsScrollable(bool isScrollable) 3085 3079 { -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h
r161452 r161530 803 803 #endif 804 804 805 void viewExposedRectChanged(const WebCore::FloatRect& exposedRect, bool clipsToExposedRect);806 805 void setMainFrameIsScrollable(bool); 807 806 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
r161452 r161530 269 269 270 270 WindowAndViewFramesChanged(WebCore::FloatRect windowFrameInScreenCoordinates, WebCore::FloatRect windowFrameInUnflippedScreenCoordinates, WebCore::FloatRect viewFrameInWindowCoordinates, WebCore::FloatPoint accessibilityViewCoordinates) 271 ViewExposedRectChanged(WebCore::FloatRect exposedRect, bool clipsToExposedRect)272 271 SetMainFrameIsScrollable(bool isScrollable) 273 272 RegisterUIProcessAccessibilityTokens(IPC::DataReference elemenToken, IPC::DataReference windowToken) -
trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h
r161452 r161530 73 73 74 74 virtual void setExposedRect(const WebCore::FloatRect&) OVERRIDE; 75 virtual void setClipsToExposedRect(bool) OVERRIDE;75 virtual WebCore::FloatRect exposedRect() const OVERRIDE { return m_scrolledExposedRect; } 76 76 77 77 // WebCore::GraphicsLayerClient … … 86 86 #endif 87 87 88 void updateMainFrameClipsToExposedRect();89 88 void updateScrolledExposedRect(); 90 89 … … 103 102 WebCore::FloatRect m_exposedRect; 104 103 WebCore::FloatRect m_scrolledExposedRect; 105 bool m_clipsToExposedRect;106 104 107 105 WebCore::Timer<RemoteLayerTreeDrawingArea> m_layerFlushTimer; -
trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm
r161452 r161530 47 47 : DrawingArea(DrawingAreaTypeRemoteLayerTree, webPage) 48 48 , m_remoteLayerTreeContext(std::make_unique<RemoteLayerTreeContext>(webPage)) 49 , m_clipsToExposedRect(false) 49 , m_exposedRect(FloatRect::infiniteRect()) 50 , m_scrolledExposedRect(FloatRect::infiniteRect()) 50 51 , m_layerFlushTimer(this, &RemoteLayerTreeDrawingArea::layerFlushTimerFired) 51 52 , m_isFlushingSuspended(false) … … 55 56 #if PLATFORM(IOS) 56 57 webPage->corePage()->settings().setDelegatesPageScaling(true); 57 setClipsToExposedRect(true);58 58 #endif 59 59 } … … 235 235 } 236 236 237 void RemoteLayerTreeDrawingArea::setClipsToExposedRect(bool clipsToExposedRect)238 {239 m_clipsToExposedRect = clipsToExposedRect;240 updateScrolledExposedRect();241 updateMainFrameClipsToExposedRect();242 }243 244 237 void RemoteLayerTreeDrawingArea::updateScrolledExposedRect() 245 238 { 246 if (!m_clipsToExposedRect)247 return;248 249 239 FrameView* frameView = m_webPage->corePage()->mainFrame().view(); 250 240 if (!frameView) … … 254 244 255 245 #if !PLATFORM(IOS) 256 IntPoint scrollPositionWithOrigin = frameView->scrollPosition() + toIntSize(frameView->scrollOrigin()); 257 m_scrolledExposedRect.moveBy(scrollPositionWithOrigin); 246 if (!m_exposedRect.isInfinite()) { 247 IntPoint scrollPositionWithOrigin = frameView->scrollPosition() + toIntSize(frameView->scrollOrigin()); 248 m_scrolledExposedRect.moveBy(scrollPositionWithOrigin); 249 } 258 250 #endif 259 251 260 mainFrameTiledBacking()->setExposedRect(m_scrolledExposedRect);261 262 for ( auto it = m_pageOverlayLayers.begin(), end = m_pageOverlayLayers.end(); it != end; ++it) {263 if (TiledBacking* tiledBacking = it->value->tiledBacking())252 frameView->setExposedRect(m_scrolledExposedRect); 253 254 for (const auto& layer : m_pageOverlayLayers.values()) { 255 if (TiledBacking* tiledBacking = layer->tiledBacking()) 264 256 tiledBacking->setExposedRect(m_scrolledExposedRect); 265 257 } 266 }267 268 void RemoteLayerTreeDrawingArea::updateMainFrameClipsToExposedRect()269 {270 if (TiledBacking* tiledBacking = mainFrameTiledBacking())271 tiledBacking->setClipsToExposedRect(m_clipsToExposedRect);272 273 for (auto it = m_pageOverlayLayers.begin(), end = m_pageOverlayLayers.end(); it != end; ++it)274 if (TiledBacking* tiledBacking = it->value->tiledBacking())275 tiledBacking->setClipsToExposedRect(m_clipsToExposedRect);276 277 FrameView* frameView = m_webPage->corePage()->mainFrame().view();278 if (!frameView)279 return;280 258 281 259 frameView->adjustTiledBackingCoverage(); -
trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h
r161452 r161530 79 79 80 80 virtual void setExposedRect(const WebCore::FloatRect&) OVERRIDE; 81 virtual void setClipsToExposedRect(bool) OVERRIDE; 81 virtual WebCore::FloatRect exposedRect() const OVERRIDE { return m_scrolledExposedRect; } 82 82 83 virtual bool supportsAsyncScrolling() OVERRIDE { return true; } 83 84 … … 120 121 121 122 void updateIntrinsicContentSizeTimerFired(WebCore::Timer<TiledCoreAnimationDrawingArea>*); 122 void updateMainFrameClipsToExposedRect();123 123 void updateScrolledExposedRect(); 124 124 … … 144 144 WebCore::FloatRect m_exposedRect; 145 145 WebCore::FloatRect m_scrolledExposedRect; 146 bool m_clipsToExposedRect;147 146 148 147 WebCore::IntSize m_lastSentIntrinsicContentSize; -
trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm
r161452 r161530 72 72 , m_layerFlushScheduler(this) 73 73 , m_isPaintingSuspended(!(parameters.viewState & ViewState::IsVisible)) 74 , m_clipsToExposedRect(false) 74 , m_exposedRect(FloatRect::infiniteRect()) 75 , m_scrolledExposedRect(FloatRect::infiniteRect()) 75 76 , m_updateIntrinsicContentSizeTimer(this, &TiledCoreAnimationDrawingArea::updateIntrinsicContentSizeTimerFired) 76 77 , m_transientZoomScale(1) … … 375 376 } 376 377 377 IntRect visibleRect = enclosingIntRect(m_rootLayer.get().frame); 378 if (m_clipsToExposedRect) 379 visibleRect.intersect(enclosingIntRect(m_scrolledExposedRect)); 378 FloatRect visibleRect = [m_rootLayer frame]; 379 visibleRect.intersect(m_scrolledExposedRect); 380 380 381 381 for (PageOverlayLayerMap::iterator it = m_pageOverlayLayers.begin(), end = m_pageOverlayLayers.end(); it != end; ++it) { … … 428 428 } 429 429 430 void TiledCoreAnimationDrawingArea::setClipsToExposedRect(bool clipsToExposedRect)431 {432 m_clipsToExposedRect = clipsToExposedRect;433 updateScrolledExposedRect();434 updateMainFrameClipsToExposedRect();435 }436 437 430 void TiledCoreAnimationDrawingArea::updateScrolledExposedRect() 438 431 { 439 if (!m_clipsToExposedRect)440 return;441 442 432 FrameView* frameView = m_webPage->corePage()->mainFrame().view(); 443 433 if (!frameView) 444 434 return; 445 435 446 IntPoint scrollPositionWithOrigin = frameView->scrollPosition() + toIntSize(frameView->scrollOrigin());447 448 436 m_scrolledExposedRect = m_exposedRect; 449 m_scrolledExposedRect.moveBy(scrollPositionWithOrigin); 450 451 mainFrameTiledBacking()->setExposedRect(m_scrolledExposedRect); 452 453 for (PageOverlayLayerMap::iterator it = m_pageOverlayLayers.begin(), end = m_pageOverlayLayers.end(); it != end; ++it) { 454 if (TiledBacking* tiledBacking = it->value->tiledBacking()) 437 438 #if !PLATFORM(IOS) 439 if (!m_exposedRect.isInfinite()) { 440 IntPoint scrollPositionWithOrigin = frameView->scrollPosition() + toIntSize(frameView->scrollOrigin()); 441 m_scrolledExposedRect.moveBy(scrollPositionWithOrigin); 442 } 443 #endif 444 445 frameView->setExposedRect(m_scrolledExposedRect); 446 447 for (const auto& layer : m_pageOverlayLayers.values()) { 448 if (TiledBacking* tiledBacking = layer->tiledBacking()) 455 449 tiledBacking->setExposedRect(m_scrolledExposedRect); 456 450 } 451 452 frameView->adjustTiledBackingCoverage(); 457 453 } 458 454 … … 561 557 } 562 558 563 void TiledCoreAnimationDrawingArea::updateMainFrameClipsToExposedRect()564 {565 if (TiledBacking* tiledBacking = mainFrameTiledBacking())566 tiledBacking->setClipsToExposedRect(m_clipsToExposedRect);567 568 for (PageOverlayLayerMap::iterator it = m_pageOverlayLayers.begin(), end = m_pageOverlayLayers.end(); it != end; ++it)569 if (TiledBacking* tiledBacking = it->value->tiledBacking())570 tiledBacking->setClipsToExposedRect(m_clipsToExposedRect);571 572 FrameView* frameView = m_webPage->corePage()->mainFrame().view();573 if (!frameView)574 return;575 576 frameView->adjustTiledBackingCoverage();577 }578 579 559 void TiledCoreAnimationDrawingArea::setRootCompositingLayer(CALayer *layer) 580 560 { … … 595 575 [m_rootLayer.get() addSublayer:it->value->platformLayer()]; 596 576 597 if (TiledBacking* tiledBacking = mainFrameTiledBacking()) {577 if (TiledBacking* tiledBacking = mainFrameTiledBacking()) 598 578 tiledBacking->setAggressivelyRetainsTiles(m_webPage->corePage()->settings().aggressiveTileRetentionEnabled()); 599 tiledBacking->setExposedRect(m_scrolledExposedRect);600 }601 602 updateMainFrameClipsToExposedRect();603 579 604 580 updateDebugInfoLayer(m_webPage->corePage()->settings().showTiledScrollingIndicator()); … … 620 596 m_pageOverlayPlatformLayers.set(layer.get(), layer->platformLayer()); 621 597 622 if (TiledBacking* tiledBacking = layer->tiledBacking()) {623 tiledBacking->setExposedRect(m_scrolledExposedRect);624 tiledBacking->setClipsToExposedRect(m_clipsToExposedRect);625 }626 627 598 [CATransaction begin]; 628 599 [CATransaction setDisableActions:YES]; … … 667 638 668 639 [CATransaction commit]; 669 670 if (TiledBacking* tiledBacking = layer->tiledBacking()) {671 tiledBacking->setExposedRect(m_scrolledExposedRect);672 tiledBacking->setClipsToExposedRect(m_clipsToExposedRect);673 }674 640 675 641 m_pageOverlayPlatformLayers.set(layer, layer->platformLayer());
Note: See TracChangeset
for help on using the changeset viewer.