Changeset 170557 in webkit
- Timestamp:
- Jun 27, 2014, 2:58:06 PM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 1 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/Source/WebCore/ChangeLog ¶
r170553 r170557 1 2014-06-27 Antti Koivisto <antti@apple.com> 2 3 Flush throttling with remote layers 4 https://bugs.webkit.org/show_bug.cgi?id=134398 5 6 Reviewed by Darin Adler. 7 8 With remote layer trees the flush scheduling lives in the WebKit2 layer. The throttling code 9 needs to live there as well. 10 11 Add the required callbacks and disable the existing throttling code in RenderLayerCompositor 12 when remote layers are in use. Later we can get rid of the RenderLayerCompositor throttling code. 13 14 * WebCore.xcodeproj/project.pbxproj: 15 * loader/FrameLoader.cpp: 16 (WebCore::FrameLoader::loadProgressingStatusChanged): 17 * page/ChromeClient.h: 18 (WebCore::ChromeClient::adjustLayerFlushThrottling): 19 * page/FrameView.cpp: 20 (WebCore::FrameView::disableLayerFlushThrottlingTemporarilyForInteraction): 21 (WebCore::FrameView::loadProgressingStatusChanged): 22 23 Factor the progress status change activities to a function. 24 25 (WebCore::FrameView::updateLayerFlushThrottling): 26 (WebCore::FrameView::setExposedRect): 27 28 Move the call to adjustTiledBackingCoverage from WebKit to here. 29 30 (WebCore::FrameView::updateLayerFlushThrottlingInAllFrames): Deleted. 31 * page/FrameView.h: 32 * page/LayerFlushThrottleState.h: Added. 33 * rendering/RenderLayerCompositor.cpp: 34 (WebCore::RenderLayerCompositor::RenderLayerCompositor): 35 1 36 2014-06-27 Brady Eidson <beidson@apple.com> 2 37 -
TabularUnified trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj ¶
r170539 r170557 6151 6151 E48944A2180B57D800F165D8 /* SimpleLineLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E48944A0180B57D800F165D8 /* SimpleLineLayout.cpp */; }; 6152 6152 E48944A3180B57D800F165D8 /* SimpleLineLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = E48944A1180B57D800F165D8 /* SimpleLineLayout.h */; settings = {ATTRIBUTES = (Private, ); }; }; 6153 E4916FF7195DF6A0005AB349 /* LayerFlushThrottleState.h in Headers */ = {isa = PBXBuildFile; fileRef = E4916FF6195DF6A0005AB349 /* LayerFlushThrottleState.h */; settings = {ATTRIBUTES = (Private, ); }; }; 6153 6154 E4946EAE156E64DD00D3297F /* StyleRuleImport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4946EAC156E64DD00D3297F /* StyleRuleImport.cpp */; }; 6154 6155 E4946EAF156E64DD00D3297F /* StyleRuleImport.h in Headers */ = {isa = PBXBuildFile; fileRef = E4946EAD156E64DD00D3297F /* StyleRuleImport.h */; }; … … 13648 13649 E48944A0180B57D800F165D8 /* SimpleLineLayout.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SimpleLineLayout.cpp; sourceTree = "<group>"; }; 13649 13650 E48944A1180B57D800F165D8 /* SimpleLineLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleLineLayout.h; sourceTree = "<group>"; }; 13651 E4916FF6195DF6A0005AB349 /* LayerFlushThrottleState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayerFlushThrottleState.h; sourceTree = "<group>"; }; 13650 13652 E4946EAC156E64DD00D3297F /* StyleRuleImport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StyleRuleImport.cpp; sourceTree = "<group>"; }; 13651 13653 E4946EAD156E64DD00D3297F /* StyleRuleImport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleRuleImport.h; sourceTree = "<group>"; }; … … 16573 16575 BC94D1510C275C8B006BC617 /* History.h */, 16574 16576 BC94D1520C275C8B006BC617 /* History.idl */, 16577 E4916FF6195DF6A0005AB349 /* LayerFlushThrottleState.h */, 16575 16578 931D72F515FE695300C4C07E /* LayoutMilestones.h */, 16576 16579 BCE1C41A0D982980003B02F2 /* Location.cpp */, … … 24363 24366 B562DB6017D3CD630010AF96 /* HTMLElementTypeHelpers.h in Headers */, 24364 24367 A871D45C0A127CBC00B12A68 /* HTMLEmbedElement.h in Headers */, 24368 E4916FF7195DF6A0005AB349 /* LayerFlushThrottleState.h in Headers */, 24365 24369 977B386A122883E900B81FF8 /* HTMLEntityParser.h in Headers */, 24366 24370 977B386C122883E900B81FF8 /* HTMLEntitySearch.h in Headers */, -
TabularUnified trunk/Source/WebCore/loader/FrameLoader.cpp ¶
r170135 r170557 3409 3409 void FrameLoader::loadProgressingStatusChanged() 3410 3410 { 3411 FrameView* view = m_frame.mainFrame().view(); 3412 if (!view) 3413 return; 3414 3415 view->updateLayerFlushThrottlingInAllFrames(); 3416 view->adjustTiledBackingCoverage(); 3411 if (auto* view = m_frame.mainFrame().view()) 3412 view->loadProgressingStatusChanged(); 3417 3413 } 3418 3414 -
TabularUnified trunk/Source/WebCore/page/ChromeClient.h ¶
r169625 r170557 30 30 #include "GraphicsContext.h" 31 31 #include "HostWindow.h" 32 #include "LayerFlushThrottleState.h" 32 33 #include "PopupMenu.h" 33 34 #include "PopupMenuClient.h" … … 328 329 virtual bool layerTreeStateIsFrozen() const { return false; } 329 330 331 virtual bool adjustLayerFlushThrottling(LayerFlushThrottleState::Flags) { return false; } 332 330 333 virtual PassRefPtr<ScrollingCoordinator> createScrollingCoordinator(Page*) const { return nullptr; } 331 334 -
TabularUnified trunk/Source/WebCore/page/FrameView.cpp ¶
r170461 r170557 2254 2254 void FrameView::disableLayerFlushThrottlingTemporarilyForInteraction() 2255 2255 { 2256 bool mainLoadProgressing = frame().page()->progress().isMainLoadProgressing(); 2257 2258 LayerFlushThrottleState::Flags flags = LayerFlushThrottleState::UserIsInteracting | (mainLoadProgressing ? LayerFlushThrottleState::MainLoadProgressing : 0); 2259 if (frame().page()->chrome().client().adjustLayerFlushThrottling(flags)) 2260 return; 2261 2256 2262 if (RenderView* view = renderView()) 2257 2263 view->compositor().disableLayerFlushThrottlingTemporarilyForInteraction(); 2258 2264 } 2259 2265 2260 void FrameView::updateLayerFlushThrottlingInAllFrames() 2261 { 2266 void FrameView::loadProgressingStatusChanged() 2267 { 2268 updateLayerFlushThrottling(); 2269 adjustTiledBackingCoverage(); 2270 } 2271 2272 void FrameView::updateLayerFlushThrottling() 2273 { 2274 ASSERT(frame().isMainFrame()); 2275 2262 2276 bool isMainLoadProgressing = frame().page()->progress().isMainLoadProgressing(); 2277 2278 // See if the client is handling throttling. 2279 LayerFlushThrottleState::Flags flags = isMainLoadProgressing ? LayerFlushThrottleState::MainLoadProgressing : 0; 2280 if (frame().page()->chrome().client().adjustLayerFlushThrottling(flags)) 2281 return; 2282 2263 2283 for (Frame* frame = m_frame.get(); frame; frame = frame->tree().traverseNext(m_frame.get())) { 2264 2284 if (RenderView* renderView = frame->contentRenderer()) … … 4421 4441 if (!m_frame->isMainFrame()) 4422 4442 return; 4423 if (TiledBacking* tiledBacking = this->tiledBacking()) 4443 if (TiledBacking* tiledBacking = this->tiledBacking()) { 4444 adjustTiledBackingCoverage(); 4424 4445 tiledBacking->setTiledScrollingIndicatorPosition(exposedRect.location()); 4446 } 4425 4447 4426 4448 if (auto* view = renderView()) -
TabularUnified trunk/Source/WebCore/page/FrameView.h ¶
r170325 r170557 291 291 292 292 void disableLayerFlushThrottlingTemporarilyForInteraction(); 293 void updateLayerFlushThrottlingInAllFrames();294 void adjustTiledBackingCoverage();295 293 bool speculativeTilingEnabled() const { return m_speculativeTilingEnabled; } 294 void loadProgressingStatusChanged(); 296 295 297 296 #if ENABLE(DASHBOARD_SUPPORT) … … 545 544 void autoSizeIfEnabled(); 546 545 546 void updateLayerFlushThrottling(); 547 void adjustTiledBackingCoverage(); 548 547 549 virtual void repaintContentRectangle(const IntRect&) override; 548 550 virtual void contentsResized() override; -
TabularUnified trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp ¶
r170541 r170557 46 46 #include "NodeList.h" 47 47 #include "Page.h" 48 #include "ProgressTracker.h"49 48 #include "RenderEmbeddedObject.h" 50 49 #include "RenderFlowThread.h" … … 285 284 , m_rootLayerAttachment(RootLayerUnattached) 286 285 , m_layerFlushTimer(this, &RenderLayerCompositor::layerFlushTimerFired) 287 , m_layerFlushThrottlingEnabled( page() && page()->progress().isMainLoadProgressing())286 , m_layerFlushThrottlingEnabled(false) 288 287 , m_layerFlushThrottlingTemporarilyDisabledForInteraction(false) 289 288 , m_hasPendingLayerFlush(false) -
TabularUnified trunk/Source/WebKit2/ChangeLog ¶
r170554 r170557 1 2014-06-27 Antti Koivisto <antti@apple.com> 2 3 Flush throttling with remote layers 4 https://bugs.webkit.org/show_bug.cgi?id=134398 5 6 Reviewed by Darin Adler. 7 8 * WebProcess/WebCoreSupport/WebChromeClient.cpp: 9 (WebKit::WebChromeClient::adjustLayerFlushThrottling): 10 * WebProcess/WebCoreSupport/WebChromeClient.h: 11 * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm: 12 * WebProcess/WebPage/DrawingArea.h: 13 (WebKit::DrawingArea::adjustLayerFlushThrottling): 14 * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: 15 * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: 16 (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea): 17 (WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect): 18 (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush): 19 20 Delay layer flushes during page loading. 21 If use interacts with the page the next flush in unthrottled even if loading is in progress. 22 23 (WebKit::RemoteLayerTreeDrawingArea::adjustLayerFlushThrottling): 24 25 Compute the new delay. The first visual flush uses a shorter delay. 26 Flush immediately when we are no longer throttling. 27 28 * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: 29 (WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect): 30 1 31 2014-06-27 Joseph Pecoraro <pecoraro@apple.com> 2 32 -
TabularUnified trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp ¶
r170320 r170557 844 844 } 845 845 846 bool WebChromeClient::adjustLayerFlushThrottling(WebCore::LayerFlushThrottleState::Flags flags) 847 { 848 return m_page->drawingArea() && m_page->drawingArea()->adjustLayerFlushThrottling(flags); 849 } 846 850 847 851 bool WebChromeClient::layerTreeStateIsFrozen() const -
TabularUnified trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h ¶
r169625 r170557 211 211 virtual void setNeedsOneShotDrawingSynchronization() override; 212 212 virtual void scheduleCompositingLayerFlush() override; 213 virtual bool adjustLayerFlushThrottling(WebCore::LayerFlushThrottleState::Flags) override; 213 214 virtual WebCore::GraphicsLayer* documentOverlayLayerForFrame(WebCore::Frame&) override; 214 215 -
TabularUnified trunk/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm ¶
r169625 r170557 29 29 #if PLATFORM(IOS) 30 30 31 #import <WebCore/NotImplemented.h>31 #import "DrawingArea.h" 32 32 #import "WebCoreArgumentCoders.h" 33 33 #import "WebFrame.h" 34 34 #import "WebPage.h" 35 35 #import "WebPageProxyMessages.h" 36 #import <WebCore/NotImplemented.h> 36 37 37 38 namespace WebKit { -
TabularUnified trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h ¶
r170348 r170557 31 31 #include <WebCore/FloatRect.h> 32 32 #include <WebCore/IntRect.h> 33 #include <WebCore/LayerFlushThrottleState.h> 33 34 #include <WebCore/PlatformScreen.h> 34 35 #include <WebCore/ViewState.h> … … 120 121 virtual bool markLayersVolatileImmediatelyIfPossible() { return true; } 121 122 123 virtual bool adjustLayerFlushThrottling(WebCore::LayerFlushThrottleState::Flags) { return false; } 124 122 125 protected: 123 126 DrawingArea(DrawingAreaType, WebPage&); -
TabularUnified trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h ¶
r170325 r170557 100 100 virtual void viewStateDidChange(WebCore::ViewState::Flags changed, bool wantsDidUpdateViewState) override; 101 101 102 virtual bool adjustLayerFlushThrottling(WebCore::LayerFlushThrottleState::Flags) override; 103 102 104 // GraphicsLayerClient 103 105 virtual void notifyAnimationStarted(const WebCore::GraphicsLayer*, double time) override { } … … 144 146 bool m_isFlushingSuspended; 145 147 bool m_hasDeferredFlush; 148 bool m_isThrottlingLayerFlushes; 149 bool m_isLayerFlushThrottlingTemporarilyDisabledForInteraction; 150 bool m_isInitialThrottledLayerFlush; 146 151 147 152 bool m_waitingForBackingStoreSwap; -
TabularUnified trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm ¶
r170377 r170557 60 60 , m_isFlushingSuspended(false) 61 61 , m_hasDeferredFlush(false) 62 , m_isThrottlingLayerFlushes(false) 63 , m_isLayerFlushThrottlingTemporarilyDisabledForInteraction(false) 64 , m_isInitialThrottledLayerFlush(false) 62 65 , m_waitingForBackingStoreSwap(false) 63 66 , m_hadFlushDeferredWhileWaitingForBackingStoreSwap(false) … … 227 230 228 231 frameView->setExposedRect(m_scrolledExposedRect); 229 frameView->adjustTiledBackingCoverage();230 232 231 233 m_webPage.pageOverlayController().didChangeExposedRect(); … … 240 242 void RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush() 241 243 { 244 if (m_isFlushingSuspended) { 245 m_isLayerFlushThrottlingTemporarilyDisabledForInteraction = false; 246 m_hasDeferredFlush = true; 247 return; 248 } 249 if (m_isLayerFlushThrottlingTemporarilyDisabledForInteraction) { 250 m_isLayerFlushThrottlingTemporarilyDisabledForInteraction = false; 251 m_layerFlushTimer.startOneShot(0_ms); 252 return; 253 } 254 242 255 if (m_layerFlushTimer.isActive()) 243 256 return; 244 257 245 m_layerFlushTimer.startOneShot(0); 258 const auto initialFlushDelay = 500_ms; 259 const auto flushDelay = 1500_ms; 260 auto throttleDelay = m_isThrottlingLayerFlushes ? (m_isInitialThrottledLayerFlush ? initialFlushDelay : flushDelay) : 0_ms; 261 m_isInitialThrottledLayerFlush = false; 262 263 m_layerFlushTimer.startOneShot(throttleDelay); 264 } 265 266 bool RemoteLayerTreeDrawingArea::adjustLayerFlushThrottling(WebCore::LayerFlushThrottleState::Flags flags) 267 { 268 if (flags & WebCore::LayerFlushThrottleState::UserIsInteracting) 269 m_isLayerFlushThrottlingTemporarilyDisabledForInteraction = true; 270 271 bool wasThrottlingLayerFlushes = m_isThrottlingLayerFlushes; 272 m_isThrottlingLayerFlushes = flags & WebCore::LayerFlushThrottleState::MainLoadProgressing; 273 274 if (!wasThrottlingLayerFlushes && m_isThrottlingLayerFlushes) 275 m_isInitialThrottledLayerFlush = true; 276 277 // Re-schedule the flush if we stopped throttling. 278 if (wasThrottlingLayerFlushes && !m_isThrottlingLayerFlushes && m_layerFlushTimer.isActive()) { 279 m_layerFlushTimer.stop(); 280 scheduleCompositingLayerFlush(); 281 } 282 return true; 246 283 } 247 284 -
TabularUnified trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm ¶
r170514 r170557 359 359 360 360 frameView->setExposedRect(m_scrolledExposedRect); 361 frameView->adjustTiledBackingCoverage();362 361 363 362 m_webPage.pageOverlayController().didChangeExposedRect();
Note:
See TracChangeset
for help on using the changeset viewer.