[Texmap] In certain situations nested blending with overflow:hidden displays clipped...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 10 Apr 2013 18:26:26 +0000 (18:26 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 10 Apr 2013 18:26:26 +0000 (18:26 +0000)
https://bugs.webkit.org/show_bug.cgi?id=114290

Patch by Noam Rosenthal <noam@webkit.org> on 2013-04-10
Reviewed by Allan Sandfeld Jensen.

Source/WebCore:

Always apply the clip when binding a surface, even if it hasn't changed.
Otherwise when binding a nested surface and rebinding its container surface,
the clip wouldn't apply.

Test: compositing/overlap-blending/nested-overlap-overflow.html

* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::BitmapTextureGL::bind):

LayoutTests:

Added a ref-test that exposes an issue with TextureMapper overlap blending when composited.
This ref-test does not show correct results on Mac, skipped in TestExpectations and created a bug.

* compositing/overlap-blending/nested-overlap-overflow-expected.html: Added.
* compositing/overlap-blending/nested-overlap-overflow.html: Added.
* platform/mac/TestExpectations: Skipped new tests and created bug.

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

LayoutTests/ChangeLog
LayoutTests/compositing/overlap-blending/nested-overlap-overflow-expected.html [new file with mode: 0644]
LayoutTests/compositing/overlap-blending/nested-overlap-overflow.html [new file with mode: 0644]
LayoutTests/platform/mac/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp

index edd2d03..7f5c0ab 100644 (file)
@@ -1,3 +1,17 @@
+2013-04-10  Noam Rosenthal  <noam@webkit.org>
+
+        [Texmap] In certain situations nested blending with overflow:hidden displays clipped results
+        https://bugs.webkit.org/show_bug.cgi?id=114290
+
+        Reviewed by Allan Sandfeld Jensen.
+
+        Added a ref-test that exposes an issue with TextureMapper overlap blending when composited.
+        This ref-test does not show correct results on Mac, skipped in TestExpectations and created a bug.
+
+        * compositing/overlap-blending/nested-overlap-overflow-expected.html: Added.
+        * compositing/overlap-blending/nested-overlap-overflow.html: Added.
+        * platform/mac/TestExpectations: Skipped new tests and created bug.
+
 2013-04-10  Victor Costan  <costan@gmail.com>
 
         Blob content type normalization.
diff --git a/LayoutTests/compositing/overlap-blending/nested-overlap-overflow-expected.html b/LayoutTests/compositing/overlap-blending/nested-overlap-overflow-expected.html
new file mode 100644 (file)
index 0000000..aaae129
--- /dev/null
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <style>
+            div {
+                opacity: 0.8;
+                border-radius: 1px;
+            }
+            body > div > div > div {
+                width: 150px;
+                height: 150px;
+                margin-left: -10px;
+                position: relative;
+                top: 0;
+                background: green;
+            }
+            body > div {
+                height: 100px;
+                overflow: hidden;
+            }
+            body > div > div {
+                width: 200px;
+                height: 200px;
+                position: absolute;
+            }
+        </style>
+    </head>
+    <body>
+        <div>
+            <div>
+                <div></div>
+            </div>
+        </div>
+    </body>
+</html>
diff --git a/LayoutTests/compositing/overlap-blending/nested-overlap-overflow.html b/LayoutTests/compositing/overlap-blending/nested-overlap-overflow.html
new file mode 100644 (file)
index 0000000..5186725
--- /dev/null
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <style>
+            div {
+                opacity: 0.8;
+                -webkit-transform: translateZ(0px);
+                border-radius: 1px;
+            }
+            body > div > div > div {
+                width: 150px;
+                height: 150px;
+                margin-left: -10px;
+                position: relative;
+                top: 0;
+                background: green;
+            }
+            body > div {
+                height: 100px;
+                overflow: hidden;
+            }
+            body > div > div {
+                width: 200px;
+                height: 200px;
+                position: absolute;
+            }
+        </style>
+    </head>
+    <body>
+        <div>
+            <div>
+                <div></div>
+            </div>
+        </div>
+    </body>
+</html>
index 6368633..318b0fb 100644 (file)
@@ -941,6 +941,9 @@ compositing/overlap-blending/reflection-opacity-huge.html
 compositing/overlap-blending/nested-overlap.html
 compositing/overlap-blending/nested-non-overlap-clipping.html
 
+# https://bugs.webkit.org/show_bug.cgi?id=114338
+compositing/overlap-blending/nested-overlap-overflow.html
+
 # https://bugs.webkit.org/show_bug.cgi?id=95027
 fast/block/float/016.html
 
index d02babb..9923777 100644 (file)
@@ -1,3 +1,19 @@
+2013-04-10  Noam Rosenthal  <noam@webkit.org>
+
+        [Texmap] In certain situations nested blending with overflow:hidden displays clipped results
+        https://bugs.webkit.org/show_bug.cgi?id=114290
+
+        Reviewed by Allan Sandfeld Jensen.
+
+        Always apply the clip when binding a surface, even if it hasn't changed.
+        Otherwise when binding a nested surface and rebinding its container surface,
+        the clip wouldn't apply.
+
+        Test: compositing/overlap-blending/nested-overlap-overflow.html
+
+        * platform/graphics/texmap/TextureMapperGL.cpp:
+        (WebCore::BitmapTextureGL::bind):
+
 2013-04-10  Antti Koivisto  <antti@apple.com>
 
         Use minimal tiles during live resize
index 1bcac18..7a35c2e 100644 (file)
@@ -1062,7 +1062,7 @@ void BitmapTextureGL::bind(TextureMapperGL* textureMapper)
     m_context3D->viewport(0, 0, m_textureSize.width(), m_textureSize.height());
     clearIfNeeded();
     textureMapper->data().projectionMatrix = createProjectionMatrix(m_textureSize, true /* mirrored */);
-    m_clipStack.applyIfNeeded(m_context3D.get());
+    m_clipStack.apply(m_context3D.get());
 }
 
 BitmapTextureGL::~BitmapTextureGL()