[GTK][WPE] Graphic issue with invalidations on composited layers with subpixel positions
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Jan 2019 10:32:03 +0000 (10:32 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Jan 2019 10:32:03 +0000 (10:32 +0000)
https://bugs.webkit.org/show_bug.cgi?id=193239

Patch by Karl Leplat <karl.leplat_ext@softathome.com> on 2019-01-14
Reviewed by Žan Doberšek.

Source/WebCore:

Test: compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions.html

* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::updateContentBuffers): Use enclosed dirty rect values
when invalidating the CoordinatedBackingStore areas.

LayoutTests:

* compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions.html: Added.
* platform/gtk/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.png: Added.
* platform/gtk/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.txt: Added.
* platform/ios/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.png: Added.
* platform/ios/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.txt: Added.
* platform/mac/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.png: Added.
* platform/mac/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.txt: Added.
* platform/wpe/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.png: Added.
* platform/wpe/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.txt: Added.

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

12 files changed:
LayoutTests/ChangeLog
LayoutTests/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions.html [new file with mode: 0644]
LayoutTests/platform/gtk/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.png [new file with mode: 0644]
LayoutTests/platform/gtk/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.txt [new file with mode: 0644]
LayoutTests/platform/ios/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.png [new file with mode: 0644]
LayoutTests/platform/ios/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.txt [new file with mode: 0644]
LayoutTests/platform/wpe/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.png [new file with mode: 0644]
LayoutTests/platform/wpe/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.txt [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp

index ea849cd..a2cedb5 100644 (file)
@@ -1,3 +1,20 @@
+2019-01-14  Karl Leplat  <karl.leplat_ext@softathome.com>
+
+        [GTK][WPE] Graphic issue with invalidations on composited layers with subpixel positions
+        https://bugs.webkit.org/show_bug.cgi?id=193239
+
+        Reviewed by Žan Doberšek.
+
+        * compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions.html: Added.
+        * platform/gtk/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.png: Added.
+        * platform/gtk/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.txt: Added.
+        * platform/ios/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.png: Added.
+        * platform/ios/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.txt: Added.
+        * platform/mac/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.png: Added.
+        * platform/mac/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.txt: Added.
+        * platform/wpe/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.png: Added.
+        * platform/wpe/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.txt: Added.
+
 2019-01-13  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [FreeType] Support emoji modifiers
diff --git a/LayoutTests/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions.html b/LayoutTests/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions.html
new file mode 100644 (file)
index 0000000..6bf977a
--- /dev/null
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+
+<html>
+    <head>
+        <style type="text/css">
+            .list_option {
+                position: relative;
+                font-size: 1.3em;
+                width: 1280px;
+                height: 1.5em;
+                background-color: #333;
+                color: white;
+            }
+            .list_option.selected {
+                background-color: #F60;
+            }
+    </style>
+    <script src="../../fast/repaint/resources/repaint.js"></script>
+    <script>
+        function repaintTest() {
+            document.getElementById("opt1").className = "list_option";
+            document.getElementById("opt2").className = "list_option";
+            document.getElementById("opt3").className = "list_option";
+            document.getElementById("opt4").className = "list_option";
+            document.getElementById("opt5").className = "list_option";
+            document.getElementById("opt6").className = "list_option";
+        }
+    </script>
+</head>
+<body onload="runRepaintTest()">
+<div id="forceAcceleratedCompositing" style="position:absolute;left:0;right:0;top:0;bottom:0;-webkit-transform: translate3d(0, 0, 0);"></div>
+
+    <div class="list_option selected" id="opt1">.</div>
+    <div class="list_option selected" id="opt2">.</div>
+    <div class="list_option selected" id="opt3">.</div>
+    <div class="list_option selected" id="opt4">.</div>
+    <div class="list_option selected" id="opt5">.</div>
+    <div class="list_option selected" id="opt6">.</div>
+</body>
+</html>
diff --git a/LayoutTests/platform/gtk/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.png b/LayoutTests/platform/gtk/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.png
new file mode 100644 (file)
index 0000000..bd0767c
Binary files /dev/null and b/LayoutTests/platform/gtk/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.png differ
diff --git a/LayoutTests/platform/gtk/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.txt b/LayoutTests/platform/gtk/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.txt
new file mode 100644 (file)
index 0000000..d6b800b
--- /dev/null
@@ -0,0 +1,31 @@
+layer at (0,0) size 1288x585
+  RenderView at (0,0) size 800x585
+layer at (0,0) size 800x203
+  RenderBlock {HTML} at (0,0) size 800x204
+    RenderBody {BODY} at (8,8) size 784x188
+layer at (0,0) size 800x585
+  RenderBlock (positioned) {DIV} at (0,0) size 800x585
+layer at (8,8) size 1280x31
+  RenderBlock (relative positioned) {DIV} at (0,0) size 1280x32 [color=#FFFFFF] [bgcolor=#333333]
+    RenderText {#text} at (0,0) size 5x24
+      text run at (0,0) width 5: "."
+layer at (8,39) size 1280x31
+  RenderBlock (relative positioned) {DIV} at (0,31) size 1280x32 [color=#FFFFFF] [bgcolor=#333333]
+    RenderText {#text} at (0,0) size 5x24
+      text run at (0,0) width 5: "."
+layer at (8,70) size 1280x32
+  RenderBlock (relative positioned) {DIV} at (0,62) size 1280x32 [color=#FFFFFF] [bgcolor=#333333]
+    RenderText {#text} at (0,0) size 5x24
+      text run at (0,0) width 5: "."
+layer at (8,102) size 1280x31
+  RenderBlock (relative positioned) {DIV} at (0,93) size 1280x32 [color=#FFFFFF] [bgcolor=#333333]
+    RenderText {#text} at (0,0) size 5x24
+      text run at (0,0) width 5: "."
+layer at (8,133) size 1280x31
+  RenderBlock (relative positioned) {DIV} at (0,124) size 1280x32 [color=#FFFFFF] [bgcolor=#333333]
+    RenderText {#text} at (0,0) size 5x24
+      text run at (0,0) width 5: "."
+layer at (8,164) size 1280x31
+  RenderBlock (relative positioned) {DIV} at (0,155) size 1280x33 [color=#FFFFFF] [bgcolor=#333333]
+    RenderText {#text} at (0,0) size 5x24
+      text run at (0,0) width 5: "."
diff --git a/LayoutTests/platform/ios/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.png b/LayoutTests/platform/ios/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.png
new file mode 100644 (file)
index 0000000..3b0a34d
Binary files /dev/null and b/LayoutTests/platform/ios/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.png differ
diff --git a/LayoutTests/platform/ios/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.txt b/LayoutTests/platform/ios/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.txt
new file mode 100644 (file)
index 0000000..78a24de
--- /dev/null
@@ -0,0 +1,31 @@
+layer at (0,0) size 1288x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x203
+  RenderBlock {HTML} at (0,0) size 800x204
+    RenderBody {BODY} at (8,8) size 784x188
+layer at (0,0) size 800x600
+  RenderBlock (positioned) {DIV} at (0,0) size 800x600
+layer at (8,8) size 1280x31
+  RenderBlock (relative positioned) {DIV} at (0,0) size 1280x32 [color=#FFFFFF] [bgcolor=#333333]
+    RenderText {#text} at (0,0) size 6x24
+      text run at (0,0) width 6: "."
+layer at (8,39) size 1280x31
+  RenderBlock (relative positioned) {DIV} at (0,31) size 1280x32 [color=#FFFFFF] [bgcolor=#333333]
+    RenderText {#text} at (0,0) size 6x24
+      text run at (0,0) width 6: "."
+layer at (8,70) size 1280x32
+  RenderBlock (relative positioned) {DIV} at (0,62) size 1280x32 [color=#FFFFFF] [bgcolor=#333333]
+    RenderText {#text} at (0,0) size 6x24
+      text run at (0,0) width 6: "."
+layer at (8,102) size 1280x31
+  RenderBlock (relative positioned) {DIV} at (0,93) size 1280x32 [color=#FFFFFF] [bgcolor=#333333]
+    RenderText {#text} at (0,0) size 6x24
+      text run at (0,0) width 6: "."
+layer at (8,133) size 1280x31
+  RenderBlock (relative positioned) {DIV} at (0,124) size 1280x32 [color=#FFFFFF] [bgcolor=#333333]
+    RenderText {#text} at (0,0) size 6x24
+      text run at (0,0) width 6: "."
+layer at (8,164) size 1280x31
+  RenderBlock (relative positioned) {DIV} at (0,155) size 1280x33 [color=#FFFFFF] [bgcolor=#333333]
+    RenderText {#text} at (0,0) size 6x24
+      text run at (0,0) width 6: "."
diff --git a/LayoutTests/platform/mac/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.png b/LayoutTests/platform/mac/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.png
new file mode 100644 (file)
index 0000000..9bf4ca1
Binary files /dev/null and b/LayoutTests/platform/mac/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.png differ
diff --git a/LayoutTests/platform/mac/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.txt b/LayoutTests/platform/mac/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.txt
new file mode 100644 (file)
index 0000000..aa62180
--- /dev/null
@@ -0,0 +1,31 @@
+layer at (0,0) size 1288x585
+  RenderView at (0,0) size 800x585
+layer at (0,0) size 800x203
+  RenderBlock {HTML} at (0,0) size 800x204
+    RenderBody {BODY} at (8,8) size 784x188
+layer at (0,0) size 800x585
+  RenderBlock (positioned) {DIV} at (0,0) size 800x585
+layer at (8,8) size 1280x31
+  RenderBlock (relative positioned) {DIV} at (0,0) size 1280x32 [color=#FFFFFF] [bgcolor=#333333]
+    RenderText {#text} at (0,0) size 6x24
+      text run at (0,0) width 6: "."
+layer at (8,39) size 1280x31
+  RenderBlock (relative positioned) {DIV} at (0,31) size 1280x32 [color=#FFFFFF] [bgcolor=#333333]
+    RenderText {#text} at (0,0) size 6x24
+      text run at (0,0) width 6: "."
+layer at (8,70) size 1280x32
+  RenderBlock (relative positioned) {DIV} at (0,62) size 1280x32 [color=#FFFFFF] [bgcolor=#333333]
+    RenderText {#text} at (0,0) size 6x24
+      text run at (0,0) width 6: "."
+layer at (8,102) size 1280x31
+  RenderBlock (relative positioned) {DIV} at (0,93) size 1280x32 [color=#FFFFFF] [bgcolor=#333333]
+    RenderText {#text} at (0,0) size 6x24
+      text run at (0,0) width 6: "."
+layer at (8,133) size 1280x31
+  RenderBlock (relative positioned) {DIV} at (0,124) size 1280x32 [color=#FFFFFF] [bgcolor=#333333]
+    RenderText {#text} at (0,0) size 6x24
+      text run at (0,0) width 6: "."
+layer at (8,164) size 1280x31
+  RenderBlock (relative positioned) {DIV} at (0,155) size 1280x33 [color=#FFFFFF] [bgcolor=#333333]
+    RenderText {#text} at (0,0) size 6x24
+      text run at (0,0) width 6: "."
diff --git a/LayoutTests/platform/wpe/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.png b/LayoutTests/platform/wpe/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.png
new file mode 100644 (file)
index 0000000..bd0767c
Binary files /dev/null and b/LayoutTests/platform/wpe/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.png differ
diff --git a/LayoutTests/platform/wpe/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.txt b/LayoutTests/platform/wpe/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.txt
new file mode 100644 (file)
index 0000000..d6b800b
--- /dev/null
@@ -0,0 +1,31 @@
+layer at (0,0) size 1288x585
+  RenderView at (0,0) size 800x585
+layer at (0,0) size 800x203
+  RenderBlock {HTML} at (0,0) size 800x204
+    RenderBody {BODY} at (8,8) size 784x188
+layer at (0,0) size 800x585
+  RenderBlock (positioned) {DIV} at (0,0) size 800x585
+layer at (8,8) size 1280x31
+  RenderBlock (relative positioned) {DIV} at (0,0) size 1280x32 [color=#FFFFFF] [bgcolor=#333333]
+    RenderText {#text} at (0,0) size 5x24
+      text run at (0,0) width 5: "."
+layer at (8,39) size 1280x31
+  RenderBlock (relative positioned) {DIV} at (0,31) size 1280x32 [color=#FFFFFF] [bgcolor=#333333]
+    RenderText {#text} at (0,0) size 5x24
+      text run at (0,0) width 5: "."
+layer at (8,70) size 1280x32
+  RenderBlock (relative positioned) {DIV} at (0,62) size 1280x32 [color=#FFFFFF] [bgcolor=#333333]
+    RenderText {#text} at (0,0) size 5x24
+      text run at (0,0) width 5: "."
+layer at (8,102) size 1280x31
+  RenderBlock (relative positioned) {DIV} at (0,93) size 1280x32 [color=#FFFFFF] [bgcolor=#333333]
+    RenderText {#text} at (0,0) size 5x24
+      text run at (0,0) width 5: "."
+layer at (8,133) size 1280x31
+  RenderBlock (relative positioned) {DIV} at (0,124) size 1280x32 [color=#FFFFFF] [bgcolor=#333333]
+    RenderText {#text} at (0,0) size 5x24
+      text run at (0,0) width 5: "."
+layer at (8,164) size 1280x31
+  RenderBlock (relative positioned) {DIV} at (0,155) size 1280x33 [color=#FFFFFF] [bgcolor=#333333]
+    RenderText {#text} at (0,0) size 5x24
+      text run at (0,0) width 5: "."
index 28e3308..c6c9f61 100644 (file)
@@ -1,3 +1,16 @@
+2019-01-14  Karl Leplat  <karl.leplat_ext@softathome.com>
+
+        [GTK][WPE] Graphic issue with invalidations on composited layers with subpixel positions
+        https://bugs.webkit.org/show_bug.cgi?id=193239
+
+        Reviewed by Žan Doberšek.
+
+        Test: compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions.html
+
+        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
+        (WebCore::CoordinatedGraphicsLayer::updateContentBuffers): Use enclosed dirty rect values
+        when invalidating the CoordinatedBackingStore areas.
+
 2019-01-13  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [FreeType] Support emoji modifiers
index 45ff951..892f6b2 100644 (file)
@@ -888,7 +888,7 @@ void CoordinatedGraphicsLayer::updateContentBuffers()
 
     if (!m_needsDisplay.completeLayer) {
         for (auto& rect : m_needsDisplay.rects)
-            layerState.mainBackingStore->invalidate(IntRect { rect });
+            layerState.mainBackingStore->invalidate(enclosingIntRect(rect));
     } else
         layerState.mainBackingStore->invalidate({ { }, IntSize { m_size } });