Title: [183894] trunk
Revision
183894
Author
d...@apple.com
Date
2015-05-06 15:46:01 -0700 (Wed, 06 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.

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 (183893 => 183894)


--- trunk/LayoutTests/ChangeLog	2015-05-06 22:35:26 UTC (rev 183893)
+++ trunk/LayoutTests/ChangeLog	2015-05-06 22:46:01 UTC (rev 183894)
@@ -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.
+
+        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.
+
 2015-05-06  Martin Robinson  <mrobin...@igalia.com>
 
         [FreeType] Vertical CJK glyphs should not be rendered with synthetic oblique

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


--- trunk/LayoutTests/compositing/media-controls-bar-appearance-big-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/compositing/media-controls-bar-appearance-big-expected.txt	2015-05-06 22:46:01 UTC (rev 183894)
@@ -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 => 183894)


--- trunk/LayoutTests/compositing/media-controls-bar-appearance-big.html	                        (rev 0)
+++ trunk/LayoutTests/compositing/media-controls-bar-appearance-big.html	2015-05-06 22:46:01 UTC (rev 183894)
@@ -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/Source/WebCore/ChangeLog (183893 => 183894)


--- trunk/Source/WebCore/ChangeLog	2015-05-06 22:35:26 UTC (rev 183893)
+++ trunk/Source/WebCore/ChangeLog	2015-05-06 22:46:01 UTC (rev 183894)
@@ -1,3 +1,24 @@
+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.
+
+        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-06  Carlos Garcia Campos  <cgar...@igalia.com> and Per Arne Vollan  <pe...@outlook.com>
 
         [WinCairo] Compile error due to undefined symbols after r183868

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


--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2015-05-06 22:35:26 UTC (rev 183893)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2015-05-06 22:46:01 UTC (rev 183894)
@@ -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 (183893 => 183894)


--- trunk/Source/WebKit2/ChangeLog	2015-05-06 22:35:26 UTC (rev 183893)
+++ trunk/Source/WebKit2/ChangeLog	2015-05-06 22:46:01 UTC (rev 183894)
@@ -1,3 +1,16 @@
+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.
+
+        Add some better logging for custom appearance.
+
+        * Shared/mac/RemoteLayerTreeTransaction.mm:
+        (WebKit::RemoteLayerTreeTextStream::operator<<):
+
 2015-05-06  Chris Dumez  <cdu...@apple.com>
 
         Disable network cache efficacy logging

Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm (183893 => 183894)


--- trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm	2015-05-06 22:35:26 UTC (rev 183893)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm	2015-05-06 22:46:01 UTC (rev 183894)
@@ -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