Cycles tests: Draw images on top of checkerboard
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 11 Aug 2017 07:34:34 +0000 (09:34 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 11 Aug 2017 11:49:50 +0000 (13:49 +0200)
This way it's easier to see alpha-channel only images, such as shadow catcher
images on transparent film.

tests/python/cycles_render_tests.py

index ffd8627dbf264de6e3ff9a58f2824dd21f23e54d..0b90ab5b55f10672cada8c5ac4d8e82ae84c264c 100755 (executable)
@@ -163,6 +163,25 @@ class Report:
     <title>Cycles Test Report</title>
     <style>
         img {{ image-rendering: pixelated; width: 256; background-color: #000; }}
+        img.render {{
+            background-color: #fff;
+            background-image:
+              -moz-linear-gradient(45deg, #eee 25%, transparent 25%),
+              -moz-linear-gradient(-45deg, #eee 25%, transparent 25%),
+              -moz-linear-gradient(45deg, transparent 75%, #eee 75%),
+              -moz-linear-gradient(-45deg, transparent 75%, #eee 75%);
+            background-image:
+              -webkit-gradient(linear, 0 100%, 100% 0, color-stop(.25, #eee), color-stop(.25, transparent)),
+              -webkit-gradient(linear, 0 0, 100% 100%, color-stop(.25, #eee), color-stop(.25, transparent)),
+              -webkit-gradient(linear, 0 100%, 100% 0, color-stop(.75, transparent), color-stop(.75, #eee)),
+              -webkit-gradient(linear, 0 0, 100% 100%, color-stop(.75, transparent), color-stop(.75, #eee));
+
+            -moz-background-size:50px 50px;
+            background-size:50px 50px;
+            -webkit-background-size:50px 51px; /* override value for shitty webkit */
+
+            background-position:0 0, 25px 0, 25px -25px, 0px 25px;
+        }}
         table td:first-child {{ width: 100%; }}
     </style>
     <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css">
@@ -206,8 +225,8 @@ class Report:
         test_html = """
             <tr{}>
                 <td><b>{}</b><br/>{}<br/>{}</td>
-                <td><img src="{}" onmouseover="this.src='{}';" onmouseout="this.src='{}';"></td>
-                <td><img src="{}" onmouseover="this.src='{}';" onmouseout="this.src='{}';"></td>
+                <td><img src="{}" onmouseover="this.src='{}';" onmouseout="this.src='{}';" class="render"></td>
+                <td><img src="{}" onmouseover="this.src='{}';" onmouseout="this.src='{}';" class="render"></td>
                 <td><img src="{}"></td>
             </tr>""" . format(style, name, self.testname, status,
                               new_url, ref_url, new_url,