Title: [284832] branches/safari-612-branch
Revision
284832
Author
[email protected]
Date
2021-10-25 14:51:03 -0700 (Mon, 25 Oct 2021)

Log Message

Cherry-pick r283979. rdar://problem/84630712

    WebGL first clear is lost when scissor is used for preserveDrawingBuffer:true in some conditions
    https://bugs.webkit.org/show_bug.cgi?id=230618
    <rdar://problem/83668270>

    Patch by Kimmo Kinnunen <[email protected]> on 2021-10-12
    Reviewed by Dean Jackson.

    Source/WebCore:

    Disable scissor for the duration of the blit from drawing buffer
    to display buffer.
    Not testable via WebGL conformance test suite as it affects the compositing.

    Test: webgl/gl-clear-preserve-drawing-buffer-bug.html

    * platform/graphics/angle/GraphicsContextGLANGLE.cpp:
    (WebCore::GraphicsContextGLOpenGL::prepareTextureImpl):

    LayoutTests:

    Add a pixel test to verify that scissor is not applied when blitting drawing buffer
    to display buffer in preserveDrawingBuffer: true case.

    * webgl/gl-clear-preserve-drawing-buffer-bug-expected.html: Added.
    * webgl/gl-clear-preserve-drawing-buffer-bug.html: Added.

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

Modified Paths

Added Paths

Diff

Modified: branches/safari-612-branch/LayoutTests/ChangeLog (284831 => 284832)


--- branches/safari-612-branch/LayoutTests/ChangeLog	2021-10-25 21:51:00 UTC (rev 284831)
+++ branches/safari-612-branch/LayoutTests/ChangeLog	2021-10-25 21:51:03 UTC (rev 284832)
@@ -1,5 +1,51 @@
 2021-10-25  Null  <[email protected]>
 
+        Cherry-pick r283979. rdar://problem/84630712
+
+    WebGL first clear is lost when scissor is used for preserveDrawingBuffer:true in some conditions
+    https://bugs.webkit.org/show_bug.cgi?id=230618
+    <rdar://problem/83668270>
+    
+    Patch by Kimmo Kinnunen <[email protected]> on 2021-10-12
+    Reviewed by Dean Jackson.
+    
+    Source/WebCore:
+    
+    Disable scissor for the duration of the blit from drawing buffer
+    to display buffer.
+    Not testable via WebGL conformance test suite as it affects the compositing.
+    
+    Test: webgl/gl-clear-preserve-drawing-buffer-bug.html
+    
+    * platform/graphics/angle/GraphicsContextGLANGLE.cpp:
+    (WebCore::GraphicsContextGLOpenGL::prepareTextureImpl):
+    
+    LayoutTests:
+    
+    Add a pixel test to verify that scissor is not applied when blitting drawing buffer
+    to display buffer in preserveDrawingBuffer: true case.
+    
+    * webgl/gl-clear-preserve-drawing-buffer-bug-expected.html: Added.
+    * webgl/gl-clear-preserve-drawing-buffer-bug.html: Added.
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@283979 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-10-12  Kimmo Kinnunen  <[email protected]>
+
+            WebGL first clear is lost when scissor is used for preserveDrawingBuffer:true in some conditions
+            https://bugs.webkit.org/show_bug.cgi?id=230618
+            <rdar://problem/83668270>
+
+            Reviewed by Dean Jackson.
+
+            Add a pixel test to verify that scissor is not applied when blitting drawing buffer
+            to display buffer in preserveDrawingBuffer: true case.
+
+            * webgl/gl-clear-preserve-drawing-buffer-bug-expected.html: Added.
+            * webgl/gl-clear-preserve-drawing-buffer-bug.html: Added.
+
+2021-10-25  Null  <[email protected]>
+
         Cherry-pick r282627. rdar://problem/84630078
 
     webgl/2.0.y/conformance/extensions/webgl-compressed-texture-s3tc-srgb.html fails on Intel+AMD Metal

Added: branches/safari-612-branch/LayoutTests/webgl/gl-clear-preserve-drawing-buffer-bug-expected.html (0 => 284832)


--- branches/safari-612-branch/LayoutTests/webgl/gl-clear-preserve-drawing-buffer-bug-expected.html	                        (rev 0)
+++ branches/safari-612-branch/LayoutTests/webgl/gl-clear-preserve-drawing-buffer-bug-expected.html	2021-10-25 21:51:03 UTC (rev 284832)
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Test for WebGL preserve drawing buffer being affected by scissor.</title>
+<script src="" </script>
+<style type=text/css>
+body { margin: 0 }
+</style>
+</head>
+<body>
+<div style="position: absolute; top: 50px; height: 50px; left: 125px; width: 50px; background-color: lime"></div>
+<div style="position: absolute; top: 100px; height: 50px; left: 0px; width: 300px; background-color: lime"></div>
+</body>
+</html>
+

Added: branches/safari-612-branch/LayoutTests/webgl/gl-clear-preserve-drawing-buffer-bug.html (0 => 284832)


--- branches/safari-612-branch/LayoutTests/webgl/gl-clear-preserve-drawing-buffer-bug.html	                        (rev 0)
+++ branches/safari-612-branch/LayoutTests/webgl/gl-clear-preserve-drawing-buffer-bug.html	2021-10-25 21:51:03 UTC (rev 284832)
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Test for WebGL preserve drawing buffer being affected by scissor.</title>
+<script src="" </script>
+<style type=text/css>
+body { margin: 0 }
+</style>
+</head>
+<body>
+<canvas style="width: 300px; height: 150px" id="c"></canvas>
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+var c = document.getElementById("c");
+var scale = window.devicePixelRatio;
+c.width = Math.floor(300. * scale);
+c.height = Math.floor(150. * scale);
+var gl = wtu.create3DContext(c, { preserveDrawingBuffer: true, antialias: false });
+gl.enable(gl.SCISSOR_TEST);
+gl.clearColor(0., 1., 0., 1);
+gl.scissor(0, 0, 300. * scale, 50. * scale);
+gl.clear(gl.COLOR_BUFFER_BIT);
+gl.scissor(125 * scale, 50 * scale, 50 * scale, 50 * scale);
+gl.clear(gl.COLOR_BUFFER_BIT);
+if (window.testRunner)
+    window.testRunner.dumpAsText(true);
+</script>
+</body>
+</html>
+

Modified: branches/safari-612-branch/Source/WebCore/ChangeLog (284831 => 284832)


--- branches/safari-612-branch/Source/WebCore/ChangeLog	2021-10-25 21:51:00 UTC (rev 284831)
+++ branches/safari-612-branch/Source/WebCore/ChangeLog	2021-10-25 21:51:03 UTC (rev 284832)
@@ -1,5 +1,54 @@
 2021-10-25  Null  <[email protected]>
 
+        Cherry-pick r283979. rdar://problem/84630712
+
+    WebGL first clear is lost when scissor is used for preserveDrawingBuffer:true in some conditions
+    https://bugs.webkit.org/show_bug.cgi?id=230618
+    <rdar://problem/83668270>
+    
+    Patch by Kimmo Kinnunen <[email protected]> on 2021-10-12
+    Reviewed by Dean Jackson.
+    
+    Source/WebCore:
+    
+    Disable scissor for the duration of the blit from drawing buffer
+    to display buffer.
+    Not testable via WebGL conformance test suite as it affects the compositing.
+    
+    Test: webgl/gl-clear-preserve-drawing-buffer-bug.html
+    
+    * platform/graphics/angle/GraphicsContextGLANGLE.cpp:
+    (WebCore::GraphicsContextGLOpenGL::prepareTextureImpl):
+    
+    LayoutTests:
+    
+    Add a pixel test to verify that scissor is not applied when blitting drawing buffer
+    to display buffer in preserveDrawingBuffer: true case.
+    
+    * webgl/gl-clear-preserve-drawing-buffer-bug-expected.html: Added.
+    * webgl/gl-clear-preserve-drawing-buffer-bug.html: Added.
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@283979 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-10-12  Kimmo Kinnunen  <[email protected]>
+
+            WebGL first clear is lost when scissor is used for preserveDrawingBuffer:true in some conditions
+            https://bugs.webkit.org/show_bug.cgi?id=230618
+            <rdar://problem/83668270>
+
+            Reviewed by Dean Jackson.
+
+            Disable scissor for the duration of the blit from drawing buffer
+            to display buffer.
+            Not testable via WebGL conformance test suite as it affects the compositing.
+
+            Test: webgl/gl-clear-preserve-drawing-buffer-bug.html
+
+            * platform/graphics/angle/GraphicsContextGLANGLE.cpp:
+            (WebCore::GraphicsContextGLOpenGL::prepareTextureImpl):
+
+2021-10-25  Null  <[email protected]>
+
         Cherry-pick r283592. rdar://problem/84625519
 
     [iOS] Transcode videos selected from UIImagePickerController

Modified: branches/safari-612-branch/Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.cpp (284831 => 284832)


--- branches/safari-612-branch/Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.cpp	2021-10-25 21:51:00 UTC (rev 284831)
+++ branches/safari-612-branch/Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.cpp	2021-10-25 21:51:03 UTC (rev 284832)
@@ -486,6 +486,8 @@
 #else
     if (m_preserveDrawingBufferTexture) {
         // Blit m_preserveDrawingBufferTexture into m_texture.
+        TemporaryANGLESetting scopedScissor(GL_SCISSOR_TEST, GL_FALSE);
+        TemporaryANGLESetting scopedDither(GL_DITHER, GL_FALSE);
         gl::BindFramebuffer(GL_DRAW_FRAMEBUFFER_ANGLE, m_preserveDrawingBufferFBO);
         gl::BindFramebuffer(GL_READ_FRAMEBUFFER_ANGLE, m_fbo);
         gl::BlitFramebufferANGLE(0, 0, m_currentWidth, m_currentHeight, 0, 0, m_currentWidth, m_currentHeight, GL_COLOR_BUFFER_BIT, GL_NEAREST);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to