Title: [138943] tags/Safari-537.24.2/Source

Diff

Modified: tags/Safari-537.24.2/Source/WebCore/ChangeLog (138942 => 138943)


--- tags/Safari-537.24.2/Source/WebCore/ChangeLog	2013-01-07 15:25:41 UTC (rev 138942)
+++ tags/Safari-537.24.2/Source/WebCore/ChangeLog	2013-01-07 15:33:50 UTC (rev 138943)
@@ -1,3 +1,56 @@
+2012-01-07  Lucas Forschler  <lforsch...@apple.com>
+
+        Merge r138858
+
+    2013-01-04  Tim Horton  <timothy_hor...@apple.com>
+
+            [wk2] Remove non-visible tiles from the layer tree
+            https://bugs.webkit.org/show_bug.cgi?id=106061
+            <rdar://problem/12761821>
+
+            Reviewed by Simon Fraser.
+
+            Unparenting tiles which aren't currently on-screen can allow underlying
+            frameworks to manage the layer's backing stores more effectively than we can.
+
+            In addition, add a setting (AggressiveTileRetentionEnabled) which keeps more
+            tiles around (we don't remove tiles in cohorts, nor when the TileCache moves
+            out of the window), which is off by default.
+
+            * WebCore.exp.in: Export Settings::setAggressiveTileRetentionEnabled.
+            * page/Settings.cpp:
+            (WebCore::Settings::Settings): Initialize m_aggressiveTileRetentionEnabled to false.
+            (WebCore::Settings::setAggressiveTileRetentionEnabled): Added.
+            * page/Settings.h:
+            (WebCore::Settings::aggressiveTileRetentionEnabled): Added.
+            * platform/graphics/TiledBacking.h: Add setter/getter to hand aggressivelyRetainsTiles through to TiledBackings.
+            * platform/graphics/ca/mac/TileCache.h:
+            (TileCache): Turn TileValidationPolicy into TileValidationPolicyFlags, and add
+            a flag for unparenting all tiles.
+            Implement aggressivelyRetainsTiles setter/getter.
+            * platform/graphics/ca/mac/TileCache.mm:
+            (WebCore::TileCache::TileCache): Initialize m_aggressivelyRetainsTiles to false.
+            (WebCore::TileCache::setIsInWindow): Revalidate tiles immediately if the TileCache has just entered the window.
+            (WebCore::TileCache::tileRevalidationTimerFired):
+            This is called if coverage rect, tile cache layer bounds, or visibility changes. We will revalidate tiles:
+                - Removing all tiles from the layer tree for background tile caches.
+                - Not pruning old tiles if the aggressiveTileRetentionEnabled setting is on.
+            (WebCore::TileCache::revalidateTiles):
+            Adopt TileValidationPolicyFlags instead of the old enum, and use separate flags for foreground/background caches.
+            Unparent tiles when they move out of the tile coverage rect.
+            Only schedule the tile cohort removal timer if we're not aggressively keeping tiles around.
+            Ensure that tiles are re-added to the TileCache layer tree if they already exist.
+            Unparent all tiles if TileValidationPolicyFlags says to (from tileRevalidationTimerFired's background flags).
+            Only add new tiles to the TileCache's layer tree if we're currently in the window.
+            Don't prune secondary tiles if the visible rect changes; this will already occur because when the visibleRect
+            changes, we arrive via tileRevalidationTimerFired, which asks for PruneSecondaryTiles anyway (except if we're
+            aggressively retaining tiles). This prevents tiles from being deleted unexpectedly during rubber-banding or when zoomed (this part of the patch is thanks to Simon).
+            (WebCore::TileCache::ensureTilesForRect):
+            Don't ensure any tiles if the TileCache is offscreen.
+            Ensure that tiles are re-added to the TileCache layer tree if they already exist.
+            (WebCore::TileCache::drawTileMapContents):
+            Draw a thick purple border around tiles that have been unparented.
+
 2012-01-04  Lucas Forschler  <lforsch...@apple.com>
 
         Merge r138877

Modified: tags/Safari-537.24.2/Source/WebCore/WebCore.exp.in (138942 => 138943)


--- tags/Safari-537.24.2/Source/WebCore/WebCore.exp.in	2013-01-07 15:25:41 UTC (rev 138942)
+++ tags/Safari-537.24.2/Source/WebCore/WebCore.exp.in	2013-01-07 15:33:50 UTC (rev 138943)
@@ -985,6 +985,7 @@
 __ZN7WebCore8Settings32setAcceleratedCompositingEnabledEb
 __ZN7WebCore8Settings32setNeedsAdobeFrameReloadingQuirkEb
 __ZN7WebCore8Settings32setScreenFontSubstitutionEnabledEb
+__ZN7WebCore8Settings33setAggressiveTileRetentionEnabledEb
 __ZN7WebCore8Settings37setScrollingPerformanceLoggingEnabledEb
 __ZN7WebCore8Settings45setShouldRespectPriorityInCSSAttributeSettersEb
 __ZN7WebCore8Settings21setResolutionOverrideERKNS_7IntSizeE

Modified: tags/Safari-537.24.2/Source/WebCore/page/Settings.cpp (138942 => 138943)


--- tags/Safari-537.24.2/Source/WebCore/page/Settings.cpp	2013-01-07 15:25:41 UTC (rev 138942)
+++ tags/Safari-537.24.2/Source/WebCore/page/Settings.cpp	2013-01-07 15:33:50 UTC (rev 138943)
@@ -186,6 +186,7 @@
     , m_touchEventEmulationEnabled(false)
 #endif
     , m_scrollingPerformanceLoggingEnabled(false)
+    , m_aggressiveTileRetentionEnabled(false)
     , m_setImageLoadingSettingsTimer(this, &Settings::imageLoadingSettingsTimerFired)
 {
     // A Frame may not have been created yet, so we initialize the AtomicString
@@ -641,6 +642,11 @@
     if (m_page->mainFrame() && m_page->mainFrame()->view())
         m_page->mainFrame()->view()->setScrollingPerformanceLoggingEnabled(enabled);
 }
+    
+void Settings::setAggressiveTileRetentionEnabled(bool enabled)
+{
+    m_aggressiveTileRetentionEnabled = enabled;
+}
 
 void Settings::setMockScrollbarsEnabled(bool flag)
 {

Modified: tags/Safari-537.24.2/Source/WebCore/page/Settings.h (138942 => 138943)


--- tags/Safari-537.24.2/Source/WebCore/page/Settings.h	2013-01-07 15:25:41 UTC (rev 138942)
+++ tags/Safari-537.24.2/Source/WebCore/page/Settings.h	2013-01-07 15:33:50 UTC (rev 138943)
@@ -292,6 +292,9 @@
 
         void setScrollingPerformanceLoggingEnabled(bool);
         bool scrollingPerformanceLoggingEnabled() { return m_scrollingPerformanceLoggingEnabled; }
+        
+        void setAggressiveTileRetentionEnabled(bool);
+        bool aggressiveTileRetentionEnabled() { return m_aggressiveTileRetentionEnabled; }
 
 #if USE(JSC)
         static void setShouldRespectPriorityInCSSAttributeSetters(bool);
@@ -366,6 +369,7 @@
         bool m_touchEventEmulationEnabled : 1;
 #endif
         bool m_scrollingPerformanceLoggingEnabled : 1;
+        bool m_aggressiveTileRetentionEnabled : 1;
 
         Timer<Settings> m_setImageLoadingSettingsTimer;
         void imageLoadingSettingsTimerFired(Timer<Settings>*);

Modified: tags/Safari-537.24.2/Source/WebCore/platform/graphics/TiledBacking.h (138942 => 138943)


--- tags/Safari-537.24.2/Source/WebCore/platform/graphics/TiledBacking.h	2013-01-07 15:25:41 UTC (rev 138942)
+++ tags/Safari-537.24.2/Source/WebCore/platform/graphics/TiledBacking.h	2013-01-07 15:33:50 UTC (rev 138943)
@@ -70,6 +70,9 @@
     virtual void setScrollingPerformanceLoggingEnabled(bool) = 0;
     virtual bool scrollingPerformanceLoggingEnabled() const = 0;
     
+    virtual void setAggressivelyRetainsTiles(bool) = 0;
+    virtual bool aggressivelyRetainsTiles() const = 0;
+
     // Exposed for testing
     virtual IntRect tileCoverageRect() const = 0;
     virtual IntRect tileGridExtent() const = 0;

Modified: tags/Safari-537.24.2/Source/WebCore/platform/graphics/ca/mac/TileCache.h (138942 => 138943)


--- tags/Safari-537.24.2/Source/WebCore/platform/graphics/ca/mac/TileCache.h	2013-01-07 15:25:41 UTC (rev 138942)
+++ tags/Safari-537.24.2/Source/WebCore/platform/graphics/ca/mac/TileCache.h	2013-01-07 15:33:50 UTC (rev 138943)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2011, 2012, 2013 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -115,6 +115,8 @@
     virtual IntRect tileGridExtent() const OVERRIDE;
     virtual void setScrollingPerformanceLoggingEnabled(bool flag) OVERRIDE { m_scrollingPerformanceLoggingEnabled = flag; }
     virtual bool scrollingPerformanceLoggingEnabled() const OVERRIDE { return m_scrollingPerformanceLoggingEnabled; }
+    virtual void setAggressivelyRetainsTiles(bool flag) OVERRIDE { m_aggressivelyRetainsTiles = flag; }
+    virtual bool aggressivelyRetainsTiles() const OVERRIDE { return m_aggressivelyRetainsTiles; }
     virtual IntRect tileCoverageRect() const OVERRIDE;
     virtual CALayer *tiledScrollingIndicatorLayer() OVERRIDE;
     virtual void setScrollingModeIndication(ScrollingModeIndication) OVERRIDE;
@@ -133,11 +135,9 @@
     void scheduleCohortRemoval();
     void cohortRemovalTimerFired(Timer<TileCache>*);
     
-    enum TileValidationPolicy {
-        KeepSecondaryTiles,
-        PruneSecondaryTiles
-    };
-    void revalidateTiles(TileValidationPolicy = KeepSecondaryTiles);
+    typedef unsigned TileValidationPolicyFlags;
+
+    void revalidateTiles(TileValidationPolicyFlags foregroundValidationPolicy = 0, TileValidationPolicyFlags backgroundValidationPolicy = 0);
     void ensureTilesForRect(const IntRect&);
     void updateTileCoverageMap();
 
@@ -191,6 +191,7 @@
     TileCoverage m_tileCoverage;
     bool m_isInWindow;
     bool m_scrollingPerformanceLoggingEnabled;
+    bool m_aggressivelyRetainsTiles;
     bool m_acceleratesDrawing;
     bool m_tilesAreOpaque;
 

Modified: tags/Safari-537.24.2/Source/WebCore/platform/graphics/ca/mac/TileCache.mm (138942 => 138943)


--- tags/Safari-537.24.2/Source/WebCore/platform/graphics/ca/mac/TileCache.mm	2013-01-07 15:25:41 UTC (rev 138942)
+++ tags/Safari-537.24.2/Source/WebCore/platform/graphics/ca/mac/TileCache.mm	2013-01-07 15:33:50 UTC (rev 138943)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2011, 2012, 2013 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -80,6 +80,11 @@
 @end
 
 namespace WebCore {
+    
+enum TileValidationPolicyFlag {
+    PruneSecondaryTiles = 1 << 0,
+    UnparentAllTiles = 1 << 1
+};
 
 static const int defaultTileCacheWidth = 512;
 static const int defaultTileCacheHeight = 512;
@@ -100,6 +105,7 @@
     , m_tileCoverage(CoverageForVisibleArea)
     , m_isInWindow(false)
     , m_scrollingPerformanceLoggingEnabled(false)
+    , m_aggressivelyRetainsTiles(false)
     , m_acceleratesDrawing(false)
     , m_tilesAreOpaque(false)
     , m_tileDebugBorderWidth(0)
@@ -242,7 +248,7 @@
     m_scale = scale;
     [m_tileContainerLayer.get() setTransform:CATransform3DMakeScale(1 / m_scale, 1 / m_scale, 1)];
 
-    revalidateTiles(PruneSecondaryTiles);
+    revalidateTiles(PruneSecondaryTiles, PruneSecondaryTiles);
 
     for (TileMap::const_iterator it = m_tiles.begin(), end = m_tiles.end(); it != end; ++it) {
         const TileInfo& tileInfo = it->value;
@@ -310,10 +316,8 @@
 
     m_isInWindow = isInWindow;
 
-    if (!m_isInWindow) {
-        const double tileRevalidationTimeout = 4;
-        scheduleTileRevalidation(tileRevalidationTimeout);
-    }
+    const double tileRevalidationTimeout = 4;
+    scheduleTileRevalidation(m_isInWindow ? 0 : tileRevalidationTimeout);
 }
 
 void TileCache::setTileCoverage(TileCoverage coverage)
@@ -440,7 +444,10 @@
 
 void TileCache::tileRevalidationTimerFired(Timer<TileCache>*)
 {
-    revalidateTiles(PruneSecondaryTiles);
+    TileValidationPolicyFlags foregroundValidationPolicy = m_aggressivelyRetainsTiles ? 0 : PruneSecondaryTiles;
+    TileValidationPolicyFlags backgroundValidationPolicy = foregroundValidationPolicy | UnparentAllTiles;
+
+    revalidateTiles(foregroundValidationPolicy, backgroundValidationPolicy);
 }
 
 unsigned TileCache::blankPixelCount() const
@@ -531,7 +538,7 @@
     }
 }
 
-void TileCache::revalidateTiles(TileValidationPolicy validationPolicy)
+void TileCache::revalidateTiles(TileValidationPolicyFlags foregroundValidationPolicy, TileValidationPolicyFlags backgroundValidationPolicy)
 {
     // If the underlying PlatformLayer has been destroyed, but the WebTileCacheLayer hasn't
     // platformLayer will be null here.
@@ -541,13 +548,9 @@
 
     if (m_visibleRect.isEmpty() || bounds().isEmpty())
         return;
-
-    // If the visible rect size changed, drop secondary tiles to avoid lots of repainting.
-    // FIXME: when scaled, this changes due to rounding. We should use FloatRects or something.
-    // Also changes on rubber banding.
-    if (m_visibleRectAtLastRevalidate.size() != m_visibleRect.size())
-        validationPolicy = PruneSecondaryTiles;
     
+    TileValidationPolicyFlags validationPolicy = m_isInWindow ? foregroundValidationPolicy : backgroundValidationPolicy;
+    
     IntRect tileCoverageRect = computeTileCoverageRect(m_visibleRectAtLastRevalidate);
     FloatRect scaledRect(tileCoverageRect);
     scaledRect.scale(m_scale);
@@ -583,6 +586,7 @@
                 if (tileInfo.cohort == VisibleTileCohort) {
                     tileInfo.cohort = currCohort;
                     ++tilesInCohort;
+                    [tileInfo.layer.get() removeFromSuperlayer];
                 }
             }
         }
@@ -590,7 +594,8 @@
         if (tilesInCohort)
             startedNewCohort(currCohort);
 
-        scheduleCohortRemoval();
+        if (!m_aggressivelyRetainsTiles)
+            scheduleCohortRemoval();
     }
 
     TileIndex topLeft;
@@ -601,7 +606,7 @@
     
     // Ensure primary tile coverage tiles.
     m_primaryTileCoverageRect = IntRect();
-    
+
     for (int y = topLeft.y(); y <= bottomRight.y(); ++y) {
         for (int x = topLeft.x(); x <= bottomRight.x(); ++x) {
             TileIndex tileIndex(x, y);
@@ -612,8 +617,12 @@
             TileInfo& tileInfo = m_tiles.add(tileIndex, TileInfo()).iterator->value;
             if (!tileInfo.layer) {
                 tileInfo.layer = createTileLayer(tileRect);
-                [m_tileContainerLayer.get() addSublayer:tileInfo.layer.get()];
+                if (m_isInWindow)
+                    [m_tileContainerLayer.get() addSublayer:tileInfo.layer.get()];
             } else {
+                if (m_isInWindow && ![tileInfo.layer.get() superlayer])
+                    [m_tileContainerLayer.get() addSublayer:tileInfo.layer.get()];
+
                 // We already have a layer for this tile. Ensure that its size is correct.
                 FloatSize tileLayerSize([tileInfo.layer.get() frame].size);
                 if (tileLayerSize == FloatSize(tileRect.size()))
@@ -628,10 +637,15 @@
         }
     }
 
-    if (validationPolicy == PruneSecondaryTiles) {
+    if (validationPolicy & PruneSecondaryTiles) {
         removeAllSecondaryTiles();
         m_cohortList.clear();
     }
+
+    if (validationPolicy & UnparentAllTiles) {
+        for (TileMap::iterator it = m_tiles.begin(), end = m_tiles.end(); it != end; ++it)
+            [it->value.layer.get() removeFromSuperlayer];
+    }
     
     if (m_tiledScrollingIndicatorLayer)
         updateTileCoverageMap();
@@ -669,7 +683,7 @@
 void TileCache::scheduleCohortRemoval()
 {
     const double cohortRemovalTimerSeconds = 1;
-    
+
     // Start the timer, or reschedule the timer from now if it's already active.
     if (!m_cohortRemovalTimer.isActive())
         m_cohortRemovalTimer.startRepeating(cohortRemovalTimerSeconds);
@@ -684,7 +698,7 @@
 
     double cohortLifeTimeSeconds = 2;
     double timeThreshold = monotonicallyIncreasingTime() - cohortLifeTimeSeconds;
-    
+
     while (!m_cohortList.isEmpty() && m_cohortList.first().creationTime < timeThreshold) {
         TileCohortInfo firstCohort = m_cohortList.takeFirst();
         removeTilesInCohort(firstCohort.cohort);
@@ -696,6 +710,9 @@
 
 void TileCache::ensureTilesForRect(const IntRect& rect)
 {
+    if (!m_isInWindow)
+        return;
+
     PlatformCALayer* platformLayer = PlatformCALayer::platformCALayer(m_tileCacheLayer);
     if (!platformLayer)
         return;
@@ -725,6 +742,9 @@
                 tileInfo.layer = createTileLayer(tileRect);
                 [m_tileContainerLayer.get() addSublayer:tileInfo.layer.get()];
             } else {
+                if (![tileInfo.layer.get() superlayer])
+                    [m_tileContainerLayer.get() addSublayer:tileInfo.layer.get()];
+
                 // We already have a layer for this tile. Ensure that its size is correct.
                 CGSize tileLayerSize = [tileInfo.layer.get() frame].size;
                 if (tileLayerSize.width >= tileRect.width() && tileLayerSize.height >= tileRect.height())
@@ -933,18 +953,14 @@
     CGContextFillRect(context, layerBounds);
 
     CGFloat scaleFactor = layerBounds.size.width / bounds().width();
-    
-    CGContextSetRGBStrokeColor(context, 0, 0, 0, 1);
 
     CGFloat contextScale = scaleFactor / scale();
     CGContextScaleCTM(context, contextScale, contextScale);
-
-    CGContextSetLineWidth(context, 0.5 / contextScale);
     
     for (TileMap::const_iterator it = m_tiles.begin(), end = m_tiles.end(); it != end; ++it) {
         const TileInfo& tileInfo = it->value;
         WebTileLayer* tileLayer = tileInfo.layer.get();
-        
+
         CGFloat red = 1;
         CGFloat green = 1;
         CGFloat blue = 1;
@@ -953,16 +969,24 @@
             green = 0.125;
             blue = 0;
         }
-        
+
         TileCohort newestCohort = newestTileCohort();
         TileCohort oldestCohort = oldestTileCohort();
-        
-        if (tileInfo.cohort != VisibleTileCohort && newestCohort > oldestCohort) {
+
+        if (!m_aggressivelyRetainsTiles && tileInfo.cohort != VisibleTileCohort && newestCohort > oldestCohort) {
             float cohortProportion = static_cast<float>((newestCohort - tileInfo.cohort)) / (newestCohort - oldestCohort);
             CGContextSetRGBFillColor(context, red, green, blue, 1 - cohortProportion);
         } else
             CGContextSetRGBFillColor(context, red, green, blue, 1);
 
+        if ([tileLayer superlayer]) {
+            CGContextSetLineWidth(context, 0.5 / contextScale);
+            CGContextSetRGBStrokeColor(context, 0, 0, 0, 1);
+        } else {
+            CGContextSetLineWidth(context, 1 / contextScale);
+            CGContextSetRGBStrokeColor(context, 0.2, 0.1, 0.9, 1);
+        }
+
         CGRect frame = [tileLayer frame];
         CGContextFillRect(context, frame);
         CGContextStrokeRect(context, frame);

Modified: tags/Safari-537.24.2/Source/WebKit2/ChangeLog (138942 => 138943)


--- tags/Safari-537.24.2/Source/WebKit2/ChangeLog	2013-01-07 15:25:41 UTC (rev 138942)
+++ tags/Safari-537.24.2/Source/WebKit2/ChangeLog	2013-01-07 15:33:50 UTC (rev 138943)
@@ -1,3 +1,28 @@
+2012-01-07  Lucas Forschler  <lforsch...@apple.com>
+
+        Merge r138858
+
+    2013-01-04  Tim Horton  <timothy_hor...@apple.com>
+
+            [wk2] Remove non-visible tiles from the layer tree
+            https://bugs.webkit.org/show_bug.cgi?id=106061
+            <rdar://problem/12761821>
+
+            Reviewed by Simon Fraser.
+
+            Add a setting to enable aggressive retention of TileCache tiles. If enabled,
+            TileCache will generally try to keep around all tiles. This setting is off by default.
+
+            * Shared/WebPreferencesStore.h:
+            * UIProcess/API/C/WKPreferences.cpp:
+            (WKPreferencesSetAggressiveTileRetentionEnabled):
+            (WKPreferencesGetAggressiveTileRetentionEnabled):
+            * UIProcess/API/C/WKPreferencesPrivate.h:
+            * WebProcess/WebPage/WebPage.cpp:
+            (WebKit::WebPage::updatePreferences):
+            * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+            (WebKit::TiledCoreAnimationDrawingArea::updatePreferences): Forward the setting to the TiledBacking.
+
 2013-01-03  Jon Lee  <jon...@apple.com>
 
         REGRESSION(r138729): crash and assertion failures in WebKit::WebProcess::plugInDidReceiveUserInteraction

Modified: tags/Safari-537.24.2/Source/WebKit2/Shared/WebPreferencesStore.h (138942 => 138943)


--- tags/Safari-537.24.2/Source/WebKit2/Shared/WebPreferencesStore.h	2013-01-07 15:25:41 UTC (rev 138942)
+++ tags/Safari-537.24.2/Source/WebKit2/Shared/WebPreferencesStore.h	2013-01-07 15:33:50 UTC (rev 138943)
@@ -142,6 +142,7 @@
     macro(PDFPluginEnabled, pdfPluginEnabled, Bool, bool, false) \
     macro(UsesEncodingDetector, usesEncodingDetector, Bool, bool, false) \
     macro(TextAutosizingEnabled, textAutosizingEnabled, Bool, bool, false) \
+    macro(AggressiveTileRetentionEnabled, aggressiveTileRetentionEnabled, Bool, bool, false) \
     \
 
 #define FOR_EACH_WEBKIT_DOUBLE_PREFERENCE(macro) \

Modified: tags/Safari-537.24.2/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp (138942 => 138943)


--- tags/Safari-537.24.2/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp	2013-01-07 15:25:41 UTC (rev 138942)
+++ tags/Safari-537.24.2/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp	2013-01-07 15:33:50 UTC (rev 138943)
@@ -994,3 +994,12 @@
     return toImpl(preferencesRef)->textAutosizingEnabled();
 }
 
+void WKPreferencesSetAggressiveTileRetentionEnabled(WKPreferencesRef preferencesRef, bool enabled)
+{
+    toImpl(preferencesRef)->setAggressiveTileRetentionEnabled(enabled);
+}
+
+bool WKPreferencesGetAggressiveTileRetentionEnabled(WKPreferencesRef preferencesRef)
+{
+    return toImpl(preferencesRef)->aggressiveTileRetentionEnabled();
+}

Modified: tags/Safari-537.24.2/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h (138942 => 138943)


--- tags/Safari-537.24.2/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h	2013-01-07 15:25:41 UTC (rev 138942)
+++ tags/Safari-537.24.2/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h	2013-01-07 15:33:50 UTC (rev 138943)
@@ -235,6 +235,10 @@
 WK_EXPORT void WKPreferencesSetPDFPluginEnabled(WKPreferencesRef preferences, bool enabled);
 WK_EXPORT bool WKPreferencesGetPDFPluginEnabled(WKPreferencesRef preferences);
 
+// Defaults to false
+WK_EXPORT void WKPreferencesSetAggressiveTileRetentionEnabled(WKPreferencesRef preferences, bool enabled);
+WK_EXPORT bool WKPreferencesGetAggressiveTileRetentionEnabled(WKPreferencesRef preferences);
+
 WK_EXPORT void WKPreferencesResetTestRunnerOverrides(WKPreferencesRef preferencesRef);
 
 #ifdef __cplusplus

Modified: tags/Safari-537.24.2/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (138942 => 138943)


--- tags/Safari-537.24.2/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2013-01-07 15:25:41 UTC (rev 138942)
+++ tags/Safari-537.24.2/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2013-01-07 15:33:50 UTC (rev 138943)
@@ -2324,6 +2324,7 @@
     settings->setShowDebugBorders(store.getBoolValueForKey(WebPreferencesKey::compositingBordersVisibleKey()));
     settings->setShowRepaintCounter(store.getBoolValueForKey(WebPreferencesKey::compositingRepaintCountersVisibleKey()));
     settings->setShowTiledScrollingIndicator(store.getBoolValueForKey(WebPreferencesKey::tiledScrollingIndicatorVisibleKey()));
+    settings->setAggressiveTileRetentionEnabled(store.getBoolValueForKey(WebPreferencesKey::aggressiveTileRetentionEnabledKey()));
     settings->setCSSCustomFilterEnabled(store.getBoolValueForKey(WebPreferencesKey::cssCustomFilterEnabledKey()));
     RuntimeEnabledFeatures::setCSSRegionsEnabled(store.getBoolValueForKey(WebPreferencesKey::cssRegionsEnabledKey()));
     settings->setCSSGridLayoutEnabled(store.getBoolValueForKey(WebPreferencesKey::cssGridLayoutEnabledKey()));

Modified: tags/Safari-537.24.2/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm (138942 => 138943)


--- tags/Safari-537.24.2/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm	2013-01-07 15:25:41 UTC (rev 138942)
+++ tags/Safari-537.24.2/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm	2013-01-07 15:33:50 UTC (rev 138943)
@@ -209,6 +209,9 @@
     bool scrollingPerformanceLoggingEnabled = m_webPage->scrollingPerformanceLoggingEnabled();
     ScrollingThread::dispatch(bind(&ScrollingTree::setScrollingPerformanceLoggingEnabled, m_webPage->corePage()->scrollingCoordinator()->scrollingTree(), scrollingPerformanceLoggingEnabled));
 
+    if (TiledBacking* tiledBacking = mainFrameTiledBacking())
+        tiledBacking->setAggressivelyRetainsTiles(m_webPage->corePage()->settings()->aggressiveTileRetentionEnabled());
+
     // Soon we want pages with fixed positioned elements to be able to be scrolled by the ScrollingCoordinator.
     // As a part of that work, we have to composite fixed position elements, and we have to allow those
     // elements to create a stacking context.
@@ -447,6 +450,9 @@
     if (m_pageOverlayLayer)
         [m_rootLayer.get() addSublayer:m_pageOverlayLayer->platformLayer()];
 
+    if (TiledBacking* tiledBacking = mainFrameTiledBacking())
+        tiledBacking->setAggressivelyRetainsTiles(m_webPage->corePage()->settings()->aggressiveTileRetentionEnabled());
+
     updateDebugInfoLayer(m_webPage->corePage()->settings()->showTiledScrollingIndicator());
 
     [CATransaction commit];
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to