Title: [134121] branches/safari-536.28-branch/Source/WebCore

Diff

Modified: branches/safari-536.28-branch/Source/WebCore/ChangeLog (134120 => 134121)


--- branches/safari-536.28-branch/Source/WebCore/ChangeLog	2012-11-09 23:27:22 UTC (rev 134120)
+++ branches/safari-536.28-branch/Source/WebCore/ChangeLog	2012-11-09 23:36:05 UTC (rev 134121)
@@ -1,5 +1,35 @@
 2012-11-09  Lucas Forschler  <lforsch...@apple.com>
 
+        Merge r130236
+
+    2012-10-02  Simon Fraser  <simon.fra...@apple.com>
+
+            Make TiledBacking slightly less aware of scrolling
+            https://bugs.webkit.org/show_bug.cgi?id=98216
+
+            Reviewed by Anders Carlsson.
+
+            TiledBacking shouldn't really care about there being scrollbars;
+            recast this in terms of "tile coverage", described by a bitfield
+            that has flags for coverage optimized for horizontal and vertical
+            scrolling. This allows for additional tile coverage behaviors later.
+
+            * page/FrameView.cpp:
+            (WebCore::FrameView::performPostLayoutTasks):
+            * platform/graphics/TiledBacking.h:
+            * platform/graphics/ca/mac/TileCache.h:
+            * platform/graphics/ca/mac/TileCache.mm:
+            (WebCore::TileCache::TileCache): Initialize m_isInWindow to false to
+            be more conservative. It gets explicitly set by the only caller now, so this is
+            not a behavior change.
+            (WebCore::TileCache::setIsInWindow):
+            (WebCore::TileCache::setTileCoverage):
+            (WebCore::TileCache::tileCoverageRect):
+            * rendering/RenderLayerBacking.cpp:
+            (WebCore::RenderLayerBacking::RenderLayerBacking):
+
+2012-11-09  Lucas Forschler  <lforsch...@apple.com>
+
         Merge r126251.
         
     2012-08-21  Julien Chaffraix  <jchaffr...@webkit.org>
@@ -207155,3 +207185,4 @@
 .
 .
 .
+.

Modified: branches/safari-536.28-branch/Source/WebCore/page/FrameView.cpp (134120 => 134121)


--- branches/safari-536.28-branch/Source/WebCore/page/FrameView.cpp	2012-11-09 23:27:22 UTC (rev 134120)
+++ branches/safari-536.28-branch/Source/WebCore/page/FrameView.cpp	2012-11-09 23:36:05 UTC (rev 134121)
@@ -2383,7 +2383,7 @@
 
 #if USE(ACCELERATED_COMPOSITING)
     if (TiledBacking* tiledBacking = this->tiledBacking())
-        tiledBacking->setCanHaveScrollbars(canHaveScrollbars());
+        tiledBacking->setTileCoverage(canHaveScrollbars() ? TiledBacking::CoverageForScrolling : TiledBacking::CoverageForVisibleArea);
 #endif
 
     scrollToAnchor();

Modified: branches/safari-536.28-branch/Source/WebCore/platform/graphics/TiledBacking.h (134120 => 134121)


--- branches/safari-536.28-branch/Source/WebCore/platform/graphics/TiledBacking.h	2012-11-09 23:27:22 UTC (rev 134120)
+++ branches/safari-536.28-branch/Source/WebCore/platform/graphics/TiledBacking.h	2012-11-09 23:36:05 UTC (rev 134121)
@@ -36,7 +36,18 @@
 
     virtual void visibleRectChanged(const IntRect&) = 0;
     virtual void setIsInWindow(bool) = 0;
-    virtual void setCanHaveScrollbars(bool) = 0;
+
+    enum {
+        CoverageForVisibleArea = 0,
+        CoverageForVerticalScrolling = 1 << 0,
+        CoverageForHorizontalScrolling = 1 << 1,
+        CoverageForScrolling = CoverageForVerticalScrolling | CoverageForHorizontalScrolling
+    };
+    typedef unsigned TileCoverage;
+
+    virtual void setTileCoverage(TileCoverage) = 0;
+    virtual TileCoverage tileCoverage() const = 0;
+
 };
 
 } // namespace WebCore

Modified: branches/safari-536.28-branch/Source/WebCore/platform/graphics/ca/mac/TileCache.h (134120 => 134121)


--- branches/safari-536.28-branch/Source/WebCore/platform/graphics/ca/mac/TileCache.h	2012-11-09 23:27:22 UTC (rev 134120)
+++ branches/safari-536.28-branch/Source/WebCore/platform/graphics/ca/mac/TileCache.h	2012-11-09 23:36:05 UTC (rev 134121)
@@ -74,7 +74,8 @@
     // TiledBacking member functions.
     virtual void visibleRectChanged(const IntRect&) OVERRIDE;
     virtual void setIsInWindow(bool) OVERRIDE;
-    virtual void setCanHaveScrollbars(bool) OVERRIDE;
+    virtual void setTileCoverage(TileCoverage) OVERRIDE;
+    virtual TileCoverage tileCoverage() const OVERRIDE { return m_tileCoverage; }
 
     IntRect bounds() const;
 
@@ -108,7 +109,7 @@
     CGFloat m_deviceScaleFactor;
 
     bool m_isInWindow;
-    bool m_canHaveScrollbars;
+    TileCoverage m_tileCoverage;
     bool m_acceleratesDrawing;
 
     RetainPtr<CGColorRef> m_tileDebugBorderColor;

Modified: branches/safari-536.28-branch/Source/WebCore/platform/graphics/ca/mac/TileCache.mm (134120 => 134121)


--- branches/safari-536.28-branch/Source/WebCore/platform/graphics/ca/mac/TileCache.mm	2012-11-09 23:27:22 UTC (rev 134120)
+++ branches/safari-536.28-branch/Source/WebCore/platform/graphics/ca/mac/TileCache.mm	2012-11-09 23:36:05 UTC (rev 134121)
@@ -57,7 +57,7 @@
     , m_scale(1)
     , m_deviceScaleFactor(1)
     , m_isInWindow(true)
-    , m_canHaveScrollbars(true)
+    , m_tileCoverage(CoverageForVisibleArea)
     , m_acceleratesDrawing(false)
     , m_tileDebugBorderWidth(0)
 {
@@ -217,18 +217,17 @@
     m_isInWindow = isInWindow;
 
     if (!m_isInWindow) {
-        // Schedule a timeout to drop tiles that are outside of the visible rect in 4 seconds.
         const double tileRevalidationTimeout = 4;
         scheduleTileRevalidation(tileRevalidationTimeout);
     }
 }
 
-void TileCache::setCanHaveScrollbars(bool canHaveScrollbars)
+void TileCache::setTileCoverage(TileCoverage coverage)
 {
-    if (m_canHaveScrollbars == canHaveScrollbars)
+    if (coverage == m_tileCoverage)
         return;
 
-    m_canHaveScrollbars = canHaveScrollbars;
+    m_tileCoverage = coverage;
     scheduleTileRevalidation(0);
 }
 
@@ -287,12 +286,15 @@
     // 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.
     // Furthermore, if the page can't have scrollbars (for example if its body element has overflow:hidden) it's very unlikely that the
     // page will ever be scrolled so we limit the tile coverage rect as well.
-    if (m_isInWindow && m_canHaveScrollbars) {
+    if (m_isInWindow) {
         // Inflate the coverage rect so that it covers 2x of the visible width and 3x of the visible height.
         // These values were chosen because it's more common to have tall pages and to scroll vertically,
         // so we keep more tiles above and below the current area.
-        tileCoverageRect.inflateX(tileCoverageRect.width() / 2);
-        tileCoverageRect.inflateY(tileCoverageRect.height());
+        if (m_tileCoverage && CoverageForHorizontalScrolling)
+            tileCoverageRect.inflateX(tileCoverageRect.width() / 2);
+
+        if (m_tileCoverage && CoverageForVerticalScrolling)
+            tileCoverageRect.inflateY(tileCoverageRect.height());
     }
 
     return tileCoverageRect;

Modified: branches/safari-536.28-branch/Source/WebCore/rendering/RenderLayerBacking.cpp (134120 => 134121)


--- branches/safari-536.28-branch/Source/WebCore/rendering/RenderLayerBacking.cpp	2012-11-09 23:27:22 UTC (rev 134120)
+++ branches/safari-536.28-branch/Source/WebCore/rendering/RenderLayerBacking.cpp	2012-11-09 23:36:05 UTC (rev 134121)
@@ -117,8 +117,9 @@
     if (m_usingTiledCacheLayer) {
         if (Page* page = renderer()->frame()->page()) {
             if (TiledBacking* tiledBacking = m_graphicsLayer->tiledBacking()) {
+                Frame* frame = renderer()->frame();
                 tiledBacking->setIsInWindow(page->isOnscreen());
-                tiledBacking->setCanHaveScrollbars(renderer()->frame()->view()->canHaveScrollbars());
+                tiledBacking->setTileCoverage(frame->view()->canHaveScrollbars() ? TiledBacking::CoverageForScrolling : TiledBacking::CoverageForVisibleArea);
             }
         }
     }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to