Only include "deep color" in layer tree dumps if a tests requests it
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Oct 2019 04:24:09 +0000 (04:24 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Oct 2019 04:24:09 +0000 (04:24 +0000)
https://bugs.webkit.org/show_bug.cgi?id=203125

Reviewed by Tim Horton.
Source/WebCore:

Layer tree dumping tests can fail when run on different devices because the "deep color"
property on layers is device-dependent. Stop dumping this by default, and have one test
that sets the bit. iphone-7 is the only device we test that has deep color support.

Tests: compositing/contents-format/deep-color-backing-store.html
       compositing/contents-format/ipad/deep-color-backing-store.html
       compositing/contents-format/iphone-7/deep-color-backing-store.html

* page/Frame.h:
* platform/graphics/GraphicsLayerClient.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::layerTreeAsText):
* testing/Internals.cpp:
(WebCore::toLayerTreeFlags):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* TestExpectations:
* compositing/contents-format/deep-color-backing-store-expected.txt: Copied from LayoutTests/platform/iphone-7/tiled-drawing/compositing-layers-deep-color-expected.txt.
* compositing/contents-format/deep-color-backing-store.html: Copied from LayoutTests/platform/iphone-7/tiled-drawing/compositing-layers-deep-color.html.
* compositing/contents-format/ipad/deep-color-backing-store-expected.txt: Copied from LayoutTests/platform/iphone-7/tiled-drawing/compositing-layers-deep-color-expected.txt.
* compositing/contents-format/ipad/deep-color-backing-store.html: Copied from LayoutTests/platform/iphone-7/tiled-drawing/compositing-layers-deep-color.html.
* compositing/contents-format/iphone-7/deep-color-backing-store-expected.txt: Copied from LayoutTests/platform/iphone-7/tiled-drawing/compositing-layers-deep-color-expected.txt.
* compositing/contents-format/iphone-7/deep-color-backing-store.html: Renamed from LayoutTests/platform/iphone-7/tiled-drawing/compositing-layers-deep-color.html.
* platform/ipad/TestExpectations:
* platform/iphone-7/TestExpectations: Added.
* platform/mac-wk1/compositing/contents-format/deep-color-backing-store-expected.txt: Renamed from LayoutTests/platform/iphone-7/tiled-drawing/compositing-layers-deep-color-expected.txt.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251273 268f45cc-cd09-0410-ab3c-d52691b4dbfc

19 files changed:
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/compositing/contents-format/deep-color-backing-store-expected.txt [new file with mode: 0644]
LayoutTests/compositing/contents-format/deep-color-backing-store.html [moved from LayoutTests/platform/iphone-7/tiled-drawing/compositing-layers-deep-color.html with 94% similarity]
LayoutTests/compositing/contents-format/ipad/deep-color-backing-store-expected.txt [new file with mode: 0644]
LayoutTests/compositing/contents-format/ipad/deep-color-backing-store.html [new file with mode: 0644]
LayoutTests/compositing/contents-format/iphone-7/deep-color-backing-store-expected.txt [moved from LayoutTests/platform/iphone-7/tiled-drawing/compositing-layers-deep-color-expected.txt with 100% similarity]
LayoutTests/compositing/contents-format/iphone-7/deep-color-backing-store.html [new file with mode: 0644]
LayoutTests/platform/ipad/TestExpectations
LayoutTests/platform/iphone-7/TestExpectations [new file with mode: 0644]
LayoutTests/platform/mac-wk1/compositing/contents-format/deep-color-backing-store-expected.txt [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/Frame.h
Source/WebCore/platform/graphics/GraphicsLayerClient.h
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl

index e691220..626e03a 100644 (file)
@@ -1,5 +1,23 @@
 2019-10-17  Simon Fraser  <simon.fraser@apple.com>
 
+        Only include "deep color" in layer tree dumps if a tests requests it
+        https://bugs.webkit.org/show_bug.cgi?id=203125
+
+        Reviewed by Tim Horton.
+
+        * TestExpectations:
+        * compositing/contents-format/deep-color-backing-store-expected.txt: Copied from LayoutTests/platform/iphone-7/tiled-drawing/compositing-layers-deep-color-expected.txt.
+        * compositing/contents-format/deep-color-backing-store.html: Copied from LayoutTests/platform/iphone-7/tiled-drawing/compositing-layers-deep-color.html.
+        * compositing/contents-format/ipad/deep-color-backing-store-expected.txt: Copied from LayoutTests/platform/iphone-7/tiled-drawing/compositing-layers-deep-color-expected.txt.
+        * compositing/contents-format/ipad/deep-color-backing-store.html: Copied from LayoutTests/platform/iphone-7/tiled-drawing/compositing-layers-deep-color.html.
+        * compositing/contents-format/iphone-7/deep-color-backing-store-expected.txt: Copied from LayoutTests/platform/iphone-7/tiled-drawing/compositing-layers-deep-color-expected.txt.
+        * compositing/contents-format/iphone-7/deep-color-backing-store.html: Renamed from LayoutTests/platform/iphone-7/tiled-drawing/compositing-layers-deep-color.html.
+        * platform/ipad/TestExpectations:
+        * platform/iphone-7/TestExpectations: Added.
+        * platform/mac-wk1/compositing/contents-format/deep-color-backing-store-expected.txt: Renamed from LayoutTests/platform/iphone-7/tiled-drawing/compositing-layers-deep-color-expected.txt.
+
+2019-10-17  Simon Fraser  <simon.fraser@apple.com>
+
         REGRESSION (r243347) Layout tests fast/events/touch/ios/drag-block-without-overflow-scroll-and-passive-observer-on* are flakey
         https://bugs.webkit.org/show_bug.cgi?id=203122
         rdar://problem/50058173
index cc2bbb2..d453a9a 100644 (file)
@@ -7,6 +7,8 @@
 #//////////////////////////////////////////////////////////////////////////////////////////
 
 compositing/ios [ Skip ]
+compositing/contents-format/ipad [ Skip ]
+compositing/contents-format/iphone-7 [ Skip ]
 css3/touch-action [ Skip ]
 accessibility/ios-simulator [ Skip ]
 accessibility/gtk [ Skip ]
diff --git a/LayoutTests/compositing/contents-format/deep-color-backing-store-expected.txt b/LayoutTests/compositing/contents-format/deep-color-backing-store-expected.txt
new file mode 100644 (file)
index 0000000..85e222b
--- /dev/null
@@ -0,0 +1,36 @@
+Box
+Box
+(GraphicsLayer
+  (anchor 0.00 0.00)
+  (bounds 5018.00 2018.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 5018.00 2018.00)
+      (contentsOpaque 1)
+      (tile cache coverage 0, 0 1024 x 1024)
+      (tile size 512 x 512)
+      (top left tile 0, 0 tiles grid 2 x 2)
+      (in window 1)
+      (children 2
+        (GraphicsLayer
+          (position 18.00 10.00)
+          (bounds 100.00 100.00)
+          (contentsOpaque 1)
+          (drawsContent 1)
+        )
+        (GraphicsLayer
+          (position 18.00 120.00)
+          (bounds 5000.00 100.00)
+          (usingTiledLayer 1)
+          (contentsOpaque 1)
+          (drawsContent 1)
+          (tile cache coverage 0, 0 1024 x 100)
+          (tile size 512 x 512)
+          (top left tile 0, 0 tiles grid 2 x 1)
+          (in window 1)
+        )
+      )
+    )
+  )
+)
+
@@ -29,7 +29,7 @@
         function doTest()
         {
             if (window.internals)
-                document.getElementById('layers').innerText = internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_TILE_CACHES);
+                document.getElementById('layers').innerText = internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_TILE_CACHES | internals.LAYER_TREE_INCLUDES_DEEP_COLOR);
         }
         window.addEventListener('load', doTest, false);
     </script>
diff --git a/LayoutTests/compositing/contents-format/ipad/deep-color-backing-store-expected.txt b/LayoutTests/compositing/contents-format/ipad/deep-color-backing-store-expected.txt
new file mode 100644 (file)
index 0000000..85e222b
--- /dev/null
@@ -0,0 +1,36 @@
+Box
+Box
+(GraphicsLayer
+  (anchor 0.00 0.00)
+  (bounds 5018.00 2018.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 5018.00 2018.00)
+      (contentsOpaque 1)
+      (tile cache coverage 0, 0 1024 x 1024)
+      (tile size 512 x 512)
+      (top left tile 0, 0 tiles grid 2 x 2)
+      (in window 1)
+      (children 2
+        (GraphicsLayer
+          (position 18.00 10.00)
+          (bounds 100.00 100.00)
+          (contentsOpaque 1)
+          (drawsContent 1)
+        )
+        (GraphicsLayer
+          (position 18.00 120.00)
+          (bounds 5000.00 100.00)
+          (usingTiledLayer 1)
+          (contentsOpaque 1)
+          (drawsContent 1)
+          (tile cache coverage 0, 0 1024 x 100)
+          (tile size 512 x 512)
+          (top left tile 0, 0 tiles grid 2 x 1)
+          (in window 1)
+        )
+      )
+    )
+  )
+)
+
diff --git a/LayoutTests/compositing/contents-format/ipad/deep-color-backing-store.html b/LayoutTests/compositing/contents-format/ipad/deep-color-backing-store.html
new file mode 100644 (file)
index 0000000..28a3d57
--- /dev/null
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <style>
+        body {
+            height: 2000px;
+        }
+        
+        .box {
+            height: 100px;
+            width: 100px;
+            background-color: blue;
+            margin: 10px;
+        }
+        
+        .composited {
+            transform: translateZ(0);
+        }
+        
+        .tiled {
+            width: 5000px;
+        }
+    </style>
+    <script>
+        if (window.testRunner)
+            testRunner.dumpAsText();
+
+        function doTest()
+        {
+            if (window.internals)
+                document.getElementById('layers').innerText = internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_TILE_CACHES | internals.LAYER_TREE_INCLUDES_DEEP_COLOR);
+        }
+        window.addEventListener('load', doTest, false);
+    </script>
+</head>
+<body>
+
+<div class="composited box">
+    Box
+</div>
+
+<div class="tiled composited box">
+    Box
+</div>
+
+<pre id="layers"></pre>
+</body>
+</html>
diff --git a/LayoutTests/compositing/contents-format/iphone-7/deep-color-backing-store.html b/LayoutTests/compositing/contents-format/iphone-7/deep-color-backing-store.html
new file mode 100644 (file)
index 0000000..28a3d57
--- /dev/null
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <style>
+        body {
+            height: 2000px;
+        }
+        
+        .box {
+            height: 100px;
+            width: 100px;
+            background-color: blue;
+            margin: 10px;
+        }
+        
+        .composited {
+            transform: translateZ(0);
+        }
+        
+        .tiled {
+            width: 5000px;
+        }
+    </style>
+    <script>
+        if (window.testRunner)
+            testRunner.dumpAsText();
+
+        function doTest()
+        {
+            if (window.internals)
+                document.getElementById('layers').innerText = internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_TILE_CACHES | internals.LAYER_TREE_INCLUDES_DEEP_COLOR);
+        }
+        window.addEventListener('load', doTest, false);
+    </script>
+</head>
+<body>
+
+<div class="composited box">
+    Box
+</div>
+
+<div class="tiled composited box">
+    Box
+</div>
+
+<pre id="layers"></pre>
+</body>
+</html>
index 4042ef7..bf9f96b 100644 (file)
@@ -2,6 +2,8 @@
 css-dark-mode [ Pass ]
 css-dark-mode/older-systems [ Skip ]
 
+compositing/contents-format/ipad [ Pass ]
+
 # iPads don't zoom when form elements are focused
 fast/visual-viewport/ios/caret-after-focus-in-fixed.html [ Skip ]
 
diff --git a/LayoutTests/platform/iphone-7/TestExpectations b/LayoutTests/platform/iphone-7/TestExpectations
new file mode 100644 (file)
index 0000000..deb5c41
--- /dev/null
@@ -0,0 +1 @@
+compositing/contents-format/iphone-7 [ Pass ]
diff --git a/LayoutTests/platform/mac-wk1/compositing/contents-format/deep-color-backing-store-expected.txt b/LayoutTests/platform/mac-wk1/compositing/contents-format/deep-color-backing-store-expected.txt
new file mode 100644 (file)
index 0000000..5b6a6d5
--- /dev/null
@@ -0,0 +1,32 @@
+Box
+Box
+(GraphicsLayer
+  (anchor 0.00 0.00)
+  (bounds 5018.00 2018.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 5018.00 2018.00)
+      (contentsOpaque 1)
+      (children 2
+        (GraphicsLayer
+          (position 18.00 10.00)
+          (bounds 100.00 100.00)
+          (contentsOpaque 1)
+          (drawsContent 1)
+        )
+        (GraphicsLayer
+          (position 18.00 120.00)
+          (bounds 5000.00 100.00)
+          (usingTiledLayer 1)
+          (contentsOpaque 1)
+          (drawsContent 1)
+          (tile cache coverage 0, 0 1024 x 100)
+          (tile size 512 x 512)
+          (top left tile 0, 0 tiles grid 2 x 1)
+          (in window 1)
+        )
+      )
+    )
+  )
+)
+
index 7d56871..2db0719 100644 (file)
@@ -1,3 +1,29 @@
+2019-10-17  Simon Fraser  <simon.fraser@apple.com>
+
+        Only include "deep color" in layer tree dumps if a tests requests it
+        https://bugs.webkit.org/show_bug.cgi?id=203125
+
+        Reviewed by Tim Horton.
+        
+        Layer tree dumping tests can fail when run on different devices because the "deep color"
+        property on layers is device-dependent. Stop dumping this by default, and have one test
+        that sets the bit. iphone-7 is the only device we test that has deep color support.
+
+        Tests: compositing/contents-format/deep-color-backing-store.html
+               compositing/contents-format/ipad/deep-color-backing-store.html
+               compositing/contents-format/iphone-7/deep-color-backing-store.html
+
+        * page/Frame.h:
+        * platform/graphics/GraphicsLayerClient.h:
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::layerTreeAsText):
+        * testing/Internals.cpp:
+        (WebCore::toLayerTreeFlags):
+        * testing/Internals.h:
+        * testing/Internals.idl:
+
 2019-10-17  Dean Jackson  <dino@apple.com>
 
         ctx.font = "" asserts in CSS parser
index 9aa1c66..dd9802c 100644 (file)
@@ -117,6 +117,7 @@ enum {
     LayerTreeFlagsIncludeBackingStoreAttached   = 1 << 8,
     LayerTreeFlagsIncludeRootLayerProperties    = 1 << 9,
     LayerTreeFlagsIncludeEventRegion            = 1 << 10,
+    LayerTreeFlagsIncludeDeepColor              = 1 << 11,
 };
 typedef unsigned LayerTreeFlags;
 
index 4d535dc..79a3f53 100644 (file)
@@ -74,6 +74,7 @@ enum LayerTreeAsTextBehaviorFlags {
     LayerTreeAsTextIncludeBackingStoreAttached  = 1 << 9,
     LayerTreeAsTextIncludeRootLayerProperties   = 1 << 10,
     LayerTreeAsTextIncludeEventRegion           = 1 << 11,
+    LayerTreeAsTextIncludeDeepColor             = 1 << 12,
     LayerTreeAsTextShowAll                      = 0xFFFF
 };
 typedef unsigned LayerTreeAsTextBehavior;
index 9b9f59c..9a4918c 100644 (file)
@@ -3753,7 +3753,7 @@ void GraphicsLayerCA::dumpAdditionalProperties(TextStream& textStream, LayerTree
         textStream << indent << "(in window " << tiledBacking()->isInWindow() << ")\n";
     }
 
-    if (m_layer->wantsDeepColorBackingStore())
+    if ((behavior & LayerTreeAsTextIncludeDeepColor) && m_layer->wantsDeepColorBackingStore())
         textStream << indent << "(deep color 1)\n";
 
     if (behavior & LayerTreeAsTextIncludeContentLayers) {
index ff9febf..f235ce1 100644 (file)
@@ -2137,6 +2137,8 @@ String RenderLayerCompositor::layerTreeAsText(LayerTreeFlags flags)
         layerTreeBehavior |= LayerTreeAsTextIncludeRootLayerProperties;
     if (flags & LayerTreeFlagsIncludeEventRegion)
         layerTreeBehavior |= LayerTreeAsTextIncludeEventRegion;
+    if (flags & LayerTreeFlagsIncludeDeepColor)
+        layerTreeBehavior |= LayerTreeAsTextIncludeDeepColor;
 
     // We skip dumping the scroll and clip layers to keep layerTreeAsText output
     // similar between platforms.
index 97389d3..82ea00d 100644 (file)
@@ -2626,6 +2626,8 @@ static LayerTreeFlags toLayerTreeFlags(unsigned short flags)
         layerTreeFlags |= LayerTreeFlagsIncludeRootLayerProperties;
     if (flags & Internals::LAYER_TREE_INCLUDES_EVENT_REGION)
         layerTreeFlags |= LayerTreeFlagsIncludeEventRegion;
+    if (flags & Internals::LAYER_TREE_INCLUDES_DEEP_COLOR)
+        layerTreeFlags |= LayerTreeFlagsIncludeDeepColor;
 
     return layerTreeFlags;
 }
index 19f789f..f9b33a2 100644 (file)
@@ -371,6 +371,7 @@ public:
         LAYER_TREE_INCLUDES_BACKING_STORE_ATTACHED = 128,
         LAYER_TREE_INCLUDES_ROOT_LAYER_PROPERTIES = 256,
         LAYER_TREE_INCLUDES_EVENT_REGION = 512,
+        LAYER_TREE_INCLUDES_DEEP_COLOR = 1024,
     };
     ExceptionOr<String> layerTreeAsText(Document&, unsigned short flags) const;
     ExceptionOr<uint64_t> layerIDForElement(Element&);
index 01db242..5ff471a 100644 (file)
@@ -398,6 +398,7 @@ enum CompositingPolicy {
     const unsigned short LAYER_TREE_INCLUDES_BACKING_STORE_ATTACHED = 128;
     const unsigned short LAYER_TREE_INCLUDES_ROOT_LAYER_PROPERTIES = 256;
     const unsigned short LAYER_TREE_INCLUDES_EVENT_REGION = 512;
+    const unsigned short LAYER_TREE_INCLUDES_DEEP_COLOR = 1024;
     [MayThrowException] DOMString layerTreeAsText(Document document, optional unsigned short flags = 0);
 
     [MayThrowException] unsigned long long layerIDForElement(Element element);