Title: [183942] trunk
Revision
183942
Author
d...@apple.com
Date
2015-05-07 13:13:47 -0700 (Thu, 07 May 2015)

Log Message

Handle backdrop views that have to tile
https://bugs.webkit.org/show_bug.cgi?id=142317
<rdar://problem/20049088>

Reviewed by Simon Fraser.

Take 2 - this was rolled out because Mavericks was crashing.

Source/WebCore:

Make sure backdrop layers don't tile. If they are big
enough, we'll leave it to the platform compositor to handle.

This also fixes a bug where if a layer changed from a backdrop
type to a tiled type, it would still retain its custom appearance
and we'd try to add children to the wrong layer.

Test: compositing/media-controls-bar-appearance-big.html

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): Check if
a layer needs a backdrop before checking if it needs to tile.

Source/WebKit2:

Add some better logging for custom appearance.

* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTextStream::operator<<):

LayoutTests:

A test that creates some backdrop views, then makes them
big enough that it would trigger tiling (which we don't want
to happen).

* compositing/media-controls-bar-appearance-big-expected.txt: Added.
* compositing/media-controls-bar-appearance-big.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (183941 => 183942)


--- trunk/LayoutTests/ChangeLog	2015-05-07 20:06:13 UTC (rev 183941)
+++ trunk/LayoutTests/ChangeLog	2015-05-07 20:13:47 UTC (rev 183942)
@@ -1,3 +1,21 @@
+2015-05-06  Dean Jackson  <d...@apple.com>
+
+        Handle backdrop views that have to tile
+        https://bugs.webkit.org/show_bug.cgi?id=142317
+        <rdar://problem/20049088>
+
+        Reviewed by Simon Fraser.
+
+        Take 2 - this was rolled out because Mavericks was crashing.
+
+        A test that creates some backdrop views, then makes them
+        big enough that it would trigger tiling (which we don't want
+        to happen).
+
+        * compositing/media-controls-bar-appearance-big-expected.txt: Added.
+        * compositing/media-controls-bar-appearance-big.html: Added.
+        * platform/mac-mavericks/TestExpectations: Skip tests on Mavericks.
+
 2015-05-07  Martin Robinson  <mrobin...@igalia.com>
 
         [GTK] All spell checking layout tests fail

Added: trunk/LayoutTests/compositing/media-controls-bar-appearance-big-expected.txt (0 => 183942)


--- trunk/LayoutTests/compositing/media-controls-bar-appearance-big-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/compositing/media-controls-bar-appearance-big-expected.txt	2015-05-07 20:13:47 UTC (rev 183942)
@@ -0,0 +1,23 @@
+(GraphicsLayer
+  (anchor 0.00 0.00)
+  (bounds 2056.00 4117.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 2056.00 4117.00)
+      (contentsOpaque 1)
+      (children 2
+        (GraphicsLayer
+          (position 8.00 8.00)
+          (bounds 2048.00 2048.00)
+          (drawsContent 1)
+        )
+        (GraphicsLayer
+          (position 8.00 2056.00)
+          (bounds 2048.00 2048.00)
+          (drawsContent 1)
+        )
+      )
+    )
+  )
+)
+
Property changes on: trunk/LayoutTests/compositing/media-controls-bar-appearance-big-expected.txt
___________________________________________________________________

Added: svn:mime-type

Added: svn:keywords

Added: svn:eol-style

Added: trunk/LayoutTests/compositing/media-controls-bar-appearance-big.html (0 => 183942)


--- trunk/LayoutTests/compositing/media-controls-bar-appearance-big.html	                        (rev 0)
+++ trunk/LayoutTests/compositing/media-controls-bar-appearance-big.html	2015-05-07 20:13:47 UTC (rev 183942)
@@ -0,0 +1,56 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <style>
+        div {
+            position: relative;
+            height: 100px;
+            width: 100px;
+        }
+        .big {
+            width: 2048px;
+            height: 2048px;
+        }
+        .media-controls {
+            -webkit-transform: translate3d(0, 0, 0); /* The element has to request a layer for the appearance to work */
+        }
+        .dark {
+            -webkit-appearance: media-controls-dark-bar-background;
+        }
+        .light {
+            -webkit-appearance: media-controls-light-bar-background;
+        }
+    </style>
+    <script>
+        if (window.testRunner) {
+            testRunner.dumpAsText();
+            testRunner.waitUntilDone();
+        }
+
+        function change()
+        {
+            var elements = document.querySelectorAll(".media-controls");
+            for (var i = 0; i < elements.length; ++i)
+                elements[i].classList.add("big");
+            setTimeout(dumpLayers, 0);
+        }
+
+        function dumpLayers()
+        {
+            var layersResult = document.getElementById('layers');
+            if (window.testRunner) {
+                layersResult.innerText = window.internals.layerTreeAsText(document);
+                testRunner.notifyDone();
+            }
+        }
+        window.addEventListener('load', change, false)
+    </script>
+</head>
+<body>
+    <div class="media-controls dark">
+    </div>
+    <div class="media-controls light">
+    </div>
+<pre id="layers"></pre>
+</body>
+</html>
Property changes on: trunk/LayoutTests/compositing/media-controls-bar-appearance-big.html
___________________________________________________________________

Added: svn:mime-type

Added: svn:keywords

Added: svn:eol-style

Modified: trunk/LayoutTests/platform/mac-mavericks/TestExpectations (183941 => 183942)


--- trunk/LayoutTests/platform/mac-mavericks/TestExpectations	2015-05-07 20:06:13 UTC (rev 183941)
+++ trunk/LayoutTests/platform/mac-mavericks/TestExpectations	2015-05-07 20:13:47 UTC (rev 183942)
@@ -5,3 +5,7 @@
 fast/events/mouse-force-changed.html [ Skip ]
 fast/events/mouse-force-down.html [ Skip ]
 fast/events/mouse-force-up.html [ Skip ]
+
+# No support for Filters Level 2
+compositing/media-controls-bar-appearance.html [ Skip ]
+compositing/media-controls-bar-appearance-big.html [ Skip ]

Modified: trunk/Source/WebCore/ChangeLog (183941 => 183942)


--- trunk/Source/WebCore/ChangeLog	2015-05-07 20:06:13 UTC (rev 183941)
+++ trunk/Source/WebCore/ChangeLog	2015-05-07 20:13:47 UTC (rev 183942)
@@ -1,3 +1,26 @@
+2015-05-06  Dean Jackson  <d...@apple.com>
+
+        Handle backdrop views that have to tile
+        https://bugs.webkit.org/show_bug.cgi?id=142317
+        <rdar://problem/20049088>
+
+        Reviewed by Simon Fraser.
+
+        Take 2 - this was rolled out because Mavericks was crashing.
+
+        Make sure backdrop layers don't tile. If they are big
+        enough, we'll leave it to the platform compositor to handle.
+
+        This also fixes a bug where if a layer changed from a backdrop
+        type to a tiled type, it would still retain its custom appearance
+        and we'd try to add children to the wrong layer.
+
+        Test: compositing/media-controls-bar-appearance-big.html
+
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): Check if
+        a layer needs a backdrop before checking if it needs to tile.
+
 2015-05-05  Myles C. Maxfield  <mmaxfi...@apple.com>
 
         Revert "Introducing the Platform Abstraction Layer (PAL)"

Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (183941 => 183942)


--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2015-05-07 20:06:13 UTC (rev 183941)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2015-05-07 20:13:47 UTC (rev 183942)
@@ -1438,10 +1438,10 @@
     bool needBackdropLayerType = (customAppearance() == LightBackdropAppearance || customAppearance() == DarkBackdropAppearance);
     PlatformCALayer::LayerType neededLayerType = m_layer->layerType();
 
-    if (needTiledLayer)
+    if (needBackdropLayerType)
+        neededLayerType = layerTypeForCustomBackdropAppearance(customAppearance());
+    else if (needTiledLayer)
         neededLayerType = PlatformCALayer::LayerTypeTiledBackingLayer;
-    else if (needBackdropLayerType)
-        neededLayerType = layerTypeForCustomBackdropAppearance(customAppearance());
     else if (isCustomBackdropLayerType(m_layer->layerType()) || m_usingTiledBacking)
         neededLayerType = PlatformCALayer::LayerTypeWebLayer;
 

Modified: trunk/Source/WebKit2/ChangeLog (183941 => 183942)


--- trunk/Source/WebKit2/ChangeLog	2015-05-07 20:06:13 UTC (rev 183941)
+++ trunk/Source/WebKit2/ChangeLog	2015-05-07 20:13:47 UTC (rev 183942)
@@ -1,3 +1,18 @@
+2015-05-06  Dean Jackson  <d...@apple.com>
+
+        Handle backdrop views that have to tile
+        https://bugs.webkit.org/show_bug.cgi?id=142317
+        <rdar://problem/20049088>
+
+        Reviewed by Simon Fraser.
+
+        Take 2 - this was rolled out because Mavericks was crashing.
+
+        Add some better logging for custom appearance.
+
+        * Shared/mac/RemoteLayerTreeTransaction.mm:
+        (WebKit::RemoteLayerTreeTextStream::operator<<):
+
 2015-05-07  Sungmann Cho  <sungmann....@navercorp.com>
 
         Add PLUGIN_ARCHITECTURE(X11) around m_frameRectInWindowCoordinates in NetscapePlugin.

Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm (183941 => 183942)


--- trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm	2015-05-07 20:06:13 UTC (rev 183941)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm	2015-05-07 20:13:47 UTC (rev 183942)
@@ -666,6 +666,7 @@
     RemoteLayerTreeTextStream& operator<<(const FilterOperations&);
     RemoteLayerTreeTextStream& operator<<(const PlatformCAAnimationRemote::Properties&);
     RemoteLayerTreeTextStream& operator<<(const RemoteLayerBackingStore&);
+    RemoteLayerTreeTextStream& operator<<(const WebCore::GraphicsLayer::CustomAppearance&);
     RemoteLayerTreeTextStream& operator<<(BlendMode);
     RemoteLayerTreeTextStream& operator<<(PlatformCAAnimation::AnimationType);
     RemoteLayerTreeTextStream& operator<<(PlatformCAAnimation::FillModeType);
@@ -837,6 +838,19 @@
     return ts;
 }
 
+RemoteLayerTreeTextStream& RemoteLayerTreeTextStream::operator<<(const WebCore::GraphicsLayer::CustomAppearance& customAppearance)
+{
+    RemoteLayerTreeTextStream& ts = *this;
+    switch (customAppearance) {
+    case WebCore::GraphicsLayer::CustomAppearance::NoCustomAppearance: ts << "none"; break;
+    case WebCore::GraphicsLayer::CustomAppearance::ScrollingOverhang: ts << "scrolling-overhang"; break;
+    case WebCore::GraphicsLayer::CustomAppearance::ScrollingShadow: ts << "scrolling-shadow"; break;
+    case WebCore::GraphicsLayer::CustomAppearance::LightBackdropAppearance: ts << "light-backdrop"; break;
+    case WebCore::GraphicsLayer::CustomAppearance::DarkBackdropAppearance: ts << "dark-backdrop"; break;
+    }
+    return ts;
+}
+
 RemoteLayerTreeTextStream& RemoteLayerTreeTextStream::operator<<(BlendMode blendMode)
 {
     RemoteLayerTreeTextStream& ts = *this;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to