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.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@183942 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index c0b92bc..7ed1f0c 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,21 @@
+2015-05-06 Dean Jackson <dino@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 <mrobinson@igalia.com>
[GTK] All spell checking layout tests fail
diff --git a/LayoutTests/compositing/media-controls-bar-appearance-big-expected.txt b/LayoutTests/compositing/media-controls-bar-appearance-big-expected.txt
new file mode 100644
index 0000000..a51a8bc
--- /dev/null
+++ b/LayoutTests/compositing/media-controls-bar-appearance-big-expected.txt
@@ -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)
+ )
+ )
+ )
+ )
+)
+
diff --git a/LayoutTests/compositing/media-controls-bar-appearance-big.html b/LayoutTests/compositing/media-controls-bar-appearance-big.html
new file mode 100644
index 0000000..0df76b1
--- /dev/null
+++ b/LayoutTests/compositing/media-controls-bar-appearance-big.html
@@ -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>
diff --git a/LayoutTests/platform/mac-mavericks/TestExpectations b/LayoutTests/platform/mac-mavericks/TestExpectations
index 40e405b..8b86a98 100644
--- a/LayoutTests/platform/mac-mavericks/TestExpectations
+++ b/LayoutTests/platform/mac-mavericks/TestExpectations
@@ -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 ]
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 0b35648..9aee651 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,26 @@
+2015-05-06 Dean Jackson <dino@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 <mmaxfield@apple.com>
Revert "Introducing the Platform Abstraction Layer (PAL)"
diff --git a/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp b/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
index a5f802b..bd6400f 100644
--- a/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
+++ b/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
@@ -1438,10 +1438,10 @@
bool needBackdropLayerType = (customAppearance() == LightBackdropAppearance || customAppearance() == DarkBackdropAppearance);
PlatformCALayer::LayerType neededLayerType = m_layer->layerType();
- if (needTiledLayer)
- neededLayerType = PlatformCALayer::LayerTypeTiledBackingLayer;
- else if (needBackdropLayerType)
+ if (needBackdropLayerType)
neededLayerType = layerTypeForCustomBackdropAppearance(customAppearance());
+ else if (needTiledLayer)
+ neededLayerType = PlatformCALayer::LayerTypeTiledBackingLayer;
else if (isCustomBackdropLayerType(m_layer->layerType()) || m_usingTiledBacking)
neededLayerType = PlatformCALayer::LayerTypeWebLayer;
diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog
index 9da4703..951ac80 100644
--- a/Source/WebKit2/ChangeLog
+++ b/Source/WebKit2/ChangeLog
@@ -1,3 +1,18 @@
+2015-05-06 Dean Jackson <dino@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.cho@navercorp.com>
Add PLUGIN_ARCHITECTURE(X11) around m_frameRectInWindowCoordinates in NetscapePlugin.
diff --git a/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm b/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm
index 3aa7b26..2760768 100644
--- a/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm
+++ b/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm
@@ -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;