Title: [87822] trunk
Revision
87822
Author
[email protected]
Date
2011-06-01 10:36:56 -0700 (Wed, 01 Jun 2011)

Log Message

2011-05-19  Adrienne Walker  <[email protected]>

        Reviewed by James Robinson.

        [chromium] Don't split long, narrow layers into multiple tiles.
        https://bugs.webkit.org/show_bug.cgi?id=60821

        These tests have imperceptible pixel changes on horizontal scrollbars
        as a result of this patch.  Marking them as failing temporarily so
        that they can be rebaselined.

        * platform/chromium/test_expectations.txt:
2011-05-19  Adrienne Walker  <[email protected]>

        Reviewed by James Robinson.

        [chromium] Don't split long, narrow layers into multiple tiles.
        https://bugs.webkit.org/show_bug.cgi?id=60821

        This changes the heuristic for when we tile layers to be less bad
        about wasting texture space.  Long, narrow layers that are tiled with
        a large tile size waste texture space.  Now layers are only tiled if
        they are above 512px in one dimension and extend into a second tile in
        the other.  If they are not tiled, their layer texture will exactly
        fit their layer bounds.  In particular, this will help scrollbars.

        * platform/graphics/chromium/ContentLayerChromium.cpp:
        (WebCore::ContentLayerChromium::updateLayerSize):
        * platform/graphics/chromium/LayerRendererChromium.h:
        (WebCore::LayerRendererChromium::maxTextureSize):

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (87821 => 87822)


--- trunk/LayoutTests/ChangeLog	2011-06-01 17:19:42 UTC (rev 87821)
+++ trunk/LayoutTests/ChangeLog	2011-06-01 17:36:56 UTC (rev 87822)
@@ -1,3 +1,16 @@
+2011-05-19  Adrienne Walker  <[email protected]>
+
+        Reviewed by James Robinson.
+
+        [chromium] Don't split long, narrow layers into multiple tiles.
+        https://bugs.webkit.org/show_bug.cgi?id=60821
+
+        These tests have imperceptible pixel changes on horizontal scrollbars
+        as a result of this patch.  Marking them as failing temporarily so
+        that they can be rebaselined.
+
+        * platform/chromium/test_expectations.txt:
+
 2011-06-01  Steve Lacey  <[email protected]>
 
         Reviewed by Eric Carlson.

Modified: trunk/LayoutTests/platform/chromium/test_expectations.txt (87821 => 87822)


--- trunk/LayoutTests/platform/chromium/test_expectations.txt	2011-06-01 17:19:42 UTC (rev 87821)
+++ trunk/LayoutTests/platform/chromium/test_expectations.txt	2011-06-01 17:36:56 UTC (rev 87822)
@@ -3903,6 +3903,10 @@
 BUGCR82950 WIN : http/tests/navigation/post-302-response.html = TEXT
 BUGCR82950 WIN : http/tests/navigation/post-303-response.html = TEXT
 
+BUGENNE GPU : compositing/geometry/fixed-position.html = FAIL
+BUGENNE GPU : compositing/geometry/vertical-scroll-composited.html = FAIL
+BUGENNE GPU : compositing/overflow/fixed-position-ancestor-clip.html = FAIL
+
 // Fails after details element turned on in Chrome r85744
 // See also BUGWK59172
 BUGWK61087 WIN MAC LINUX : fast/multicol/span/clone-anonymous-block-non-inline-child-crash.html = TEXT

Modified: trunk/Source/WebCore/ChangeLog (87821 => 87822)


--- trunk/Source/WebCore/ChangeLog	2011-06-01 17:19:42 UTC (rev 87821)
+++ trunk/Source/WebCore/ChangeLog	2011-06-01 17:36:56 UTC (rev 87822)
@@ -1,3 +1,22 @@
+2011-05-19  Adrienne Walker  <[email protected]>
+
+        Reviewed by James Robinson.
+
+        [chromium] Don't split long, narrow layers into multiple tiles.
+        https://bugs.webkit.org/show_bug.cgi?id=60821
+
+        This changes the heuristic for when we tile layers to be less bad
+        about wasting texture space.  Long, narrow layers that are tiled with
+        a large tile size waste texture space.  Now layers are only tiled if
+        they are above 512px in one dimension and extend into a second tile in
+        the other.  If they are not tiled, their layer texture will exactly
+        fit their layer bounds.  In particular, this will help scrollbars.
+
+        * platform/graphics/chromium/ContentLayerChromium.cpp:
+        (WebCore::ContentLayerChromium::updateLayerSize):
+        * platform/graphics/chromium/LayerRendererChromium.h:
+        (WebCore::LayerRendererChromium::maxTextureSize):
+
 2011-06-01  Cary Clark  <[email protected]>
 
         Reviewed by Eric Seidel.

Modified: trunk/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp (87821 => 87822)


--- trunk/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp	2011-06-01 17:19:42 UTC (rev 87821)
+++ trunk/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp	2011-06-01 17:36:56 UTC (rev 87822)
@@ -46,9 +46,9 @@
 #include "TextStream.h"
 #include <wtf/CurrentTime.h>
 
-// Maximum size the width or height of this layer can be before enabling tiling
-// when m_tilingOption == AutoTile.
+// Start tiling when the width and height of a layer are larger than this size.
 static int maxUntiledSize = 512;
+
 // When tiling is enabled, use tiles of this dimension squared.
 static int defaultTileSize = 256;
 
@@ -186,8 +186,14 @@
         return;
 
     const IntSize tileSize(min(defaultTileSize, layerSize.width()), min(defaultTileSize, layerSize.height()));
-    const bool autoTiled = layerSize.width() > maxUntiledSize || layerSize.height() > maxUntiledSize;
 
+    // Tile if both dimensions large, or any one dimension large and the other
+    // extends into a second tile. This heuristic allows for long skinny layers
+    // (e.g. scrollbars) that are Nx1 tiles to minimize wasted texture space.
+    const bool anyDimensionLarge = layerSize.width() > maxUntiledSize || layerSize.height() > maxUntiledSize;
+    const bool anyDimensionOneTile = layerSize.width() <= defaultTileSize || layerSize.height() <= defaultTileSize;
+    const bool autoTiled = anyDimensionLarge && !anyDimensionOneTile;
+
     bool isTiled;
     if (m_tilingOption == AlwaysTile)
         isTiled = true;
@@ -196,7 +202,10 @@
     else
         isTiled = autoTiled;
 
-    m_tiler->setTileSize(isTiled ? tileSize : layerSize);
+    IntSize requestedSize = isTiled ? tileSize : layerSize;
+    const int maxSize = layerRenderer()->maxTextureSize();
+    IntSize clampedSize = requestedSize.shrunkTo(IntSize(maxSize, maxSize));
+    m_tiler->setTileSize(clampedSize);
 }
 
 void ContentLayerChromium::draw(const IntRect& targetSurfaceRect)

Modified: trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h (87821 => 87822)


--- trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h	2011-06-01 17:19:42 UTC (rev 87821)
+++ trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h	2011-06-01 17:36:56 UTC (rev 87822)
@@ -121,6 +121,7 @@
     const TransformationMatrix& projectionMatrix() const { return m_projectionMatrix; }
 
     bool checkTextureSize(const IntSize&);
+    int maxTextureSize() const { return m_maxTextureSize; }
 
     const GeometryBinding* sharedGeometry() const { return m_sharedGeometry.get(); }
     const LayerChromium::BorderProgram* borderProgram() const { return m_borderProgram.get(); }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to