Changeset 162640 in webkit
- Timestamp:
- Jan 23, 2014, 2:03:27 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r162637 r162640 1 2014-01-23 Antti Koivisto <antti@apple.com> 2 3 Don't enable speculative tiles immediately after main load stops progressing 4 https://bugs.webkit.org/show_bug.cgi?id=127507 5 6 Reviewed by Andreas Kling. 7 8 It is common for timers and events to trigger more loading after the initial main frame loading 9 has completed. We should delay a bit before enabling speculative tiles and keep them disabled 10 if loading still continues. 11 12 * page/FrameView.cpp: 13 (WebCore::FrameView::FrameView): 14 (WebCore::FrameView::adjustTiledBackingCoverage): 15 (WebCore::shouldEnableSpeculativeTilingDuringLoading): 16 (WebCore::FrameView::enableSpeculativeTilingIfNeeded): 17 18 When load progression stops wait 0.5s before enabling speculative tiles. 19 20 (WebCore::FrameView::speculativeTilingEnableTimerFired): 21 22 Don't enable speculative tiles if the progression has started again. Instead restart the timer. 23 24 * page/FrameView.h: 25 * rendering/RenderLayerBacking.cpp: 26 (WebCore::RenderLayerBacking::RenderLayerBacking): 27 (WebCore::computeTileCoverage): 28 29 Move the FrameView level code to FrameView (so we don't need to add a timer to every RenderLayerBacking). 30 31 * rendering/RenderLayerBacking.h: 32 1 33 2014-01-23 Antti Koivisto <antti@apple.com> 2 34 -
trunk/Source/WebCore/page/FrameView.cpp
r162597 r162640 205 205 , m_deferSetNeedsLayouts(0) 206 206 , m_setNeedsLayoutWasDeferred(false) 207 , m_speculativeTilingEnabled(false) 208 , m_speculativeTilingEnableTimer(this, &FrameView::speculativeTilingEnableTimerFired) 207 209 #if PLATFORM(IOS) 208 210 , m_useCustomFixedPositionLayoutRect(false) … … 2427 2429 void FrameView::adjustTiledBackingCoverage() 2428 2430 { 2431 if (!m_speculativeTilingEnabled) 2432 enableSpeculativeTilingIfNeeded(); 2433 2429 2434 #if USE(ACCELERATED_COMPOSITING) 2430 2435 RenderView* renderView = this->renderView(); … … 2434 2439 #if PLATFORM(IOS) 2435 2440 if (TileCache* tileCache = this->tileCache()) 2436 tileCache->setSpeculativeTileCreationEnabled(!m_frame->page()->progress().isMainLoadProgressing()); 2437 #endif 2441 tileCache->setSpeculativeTileCreationEnabled(m_speculativeTilingEnabled); 2442 #endif 2443 } 2444 2445 static bool shouldEnableSpeculativeTilingDuringLoading(const FrameView& view) 2446 { 2447 return view.isVisuallyNonEmpty() && !view.frame().page()->progress().isMainLoadProgressing(); 2448 } 2449 2450 void FrameView::enableSpeculativeTilingIfNeeded() 2451 { 2452 ASSERT(!m_speculativeTilingEnabled); 2453 if (m_wasScrolledByUser) { 2454 m_speculativeTilingEnabled = true; 2455 return; 2456 } 2457 if (!shouldEnableSpeculativeTilingDuringLoading(*this)) 2458 return; 2459 if (m_speculativeTilingEnableTimer.isActive()) 2460 return; 2461 // Delay enabling a bit as load completion may trigger further loading from scripts. 2462 static const double speculativeTilingEnableDelay = 0.5; 2463 m_speculativeTilingEnableTimer.startOneShot(speculativeTilingEnableDelay); 2464 } 2465 2466 void FrameView::speculativeTilingEnableTimerFired(Timer<FrameView>&) 2467 { 2468 if (m_speculativeTilingEnabled) 2469 return; 2470 m_speculativeTilingEnabled = shouldEnableSpeculativeTilingDuringLoading(*this); 2471 adjustTiledBackingCoverage(); 2438 2472 } 2439 2473 -
trunk/Source/WebCore/page/FrameView.h
r162597 r162640 270 270 void updateLayerFlushThrottlingInAllFrames(); 271 271 void adjustTiledBackingCoverage(); 272 bool speculativeTilingEnabled() const { return m_speculativeTilingEnabled; } 272 273 273 274 #if ENABLE(DASHBOARD_SUPPORT) || ENABLE(DRAGGABLE_REGION) … … 558 559 double adjustedDeferredRepaintDelay() const; 559 560 561 void enableSpeculativeTilingIfNeeded(); 562 void speculativeTilingEnableTimerFired(Timer<FrameView>&); 563 560 564 bool updateEmbeddedObjects(); 561 565 void updateEmbeddedObject(RenderEmbeddedObject&); … … 664 668 // Renderer to hold our custom scroll corner. 665 669 RenderPtr<RenderScrollbarPart> m_scrollCorner; 670 671 bool m_speculativeTilingEnabled; 672 Timer<FrameView> m_speculativeTilingEnableTimer; 666 673 667 674 #if PLATFORM(IOS) -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r162605 r162640 124 124 #endif 125 125 , m_backgroundLayerPaintsFixedRootBackground(false) 126 , m_didSwitchToFullTileCoverageDuringLoading(false)127 126 { 128 127 Page* page = renderer().frame().page(); … … 221 220 TiledBacking::TileCoverage tileCoverage = TiledBacking::CoverageForVisibleArea; 222 221 bool useMinimalTilesDuringLiveResize = frameView.inLiveResize(); 223 bool useMinimalTilesDuringLoading = false; 224 // Avoid churn. 225 if (!backing->didSwitchToFullTileCoverageDuringLoading()) { 226 useMinimalTilesDuringLoading = !frameView.isVisuallyNonEmpty() || (frameView.frame().page()->progress().isMainLoadProgressing() && !frameView.wasScrolledByUser()); 227 if (!useMinimalTilesDuringLoading) 228 backing->setDidSwitchToFullTileCoverageDuringLoading(); 229 } 230 if (!(useMinimalTilesDuringLoading || useMinimalTilesDuringLiveResize)) { 222 if (frameView.speculativeTilingEnabled() && !useMinimalTilesDuringLiveResize) { 231 223 bool clipsToExposedRect = !frameView.exposedRect().isInfinite(); 232 224 if (frameView.horizontalScrollbarMode() != ScrollbarAlwaysOff || clipsToExposedRect) -
trunk/Source/WebCore/rendering/RenderLayerBacking.h
r162230 r162640 203 203 double backingStoreMemoryEstimate() const; 204 204 205 bool didSwitchToFullTileCoverageDuringLoading() const { return m_didSwitchToFullTileCoverageDuringLoading; }206 void setDidSwitchToFullTileCoverageDuringLoading() { m_didSwitchToFullTileCoverageDuringLoading = true; }207 208 205 #if ENABLE(CSS_COMPOSITING) 209 206 void setBlendMode(BlendMode); … … 325 322 #endif 326 323 bool m_backgroundLayerPaintsFixedRootBackground; 327 bool m_didSwitchToFullTileCoverageDuringLoading;328 324 329 325 static bool m_creatingPrimaryGraphicsLayer;
Note:
See TracChangeset
for help on using the changeset viewer.