Title: [291410] branches/safari-614.1.6-branch/Source/WebKit
Revision
291410
Author
[email protected]
Date
2022-03-17 08:45:29 -0700 (Thu, 17 Mar 2022)

Log Message

Cherry-pick r291314. rdar://problem/90245766

    RemoteGraphicsContextGLProxy omits context lost checks for back and front buffer access functions
    https://bugs.webkit.org/show_bug.cgi?id=237891

    Patch by Kimmo Kinnunen <[email protected]> on 2022-03-15
    Reviewed by Myles Maxfield.

    Add missing isContextLost() checks to RemoteGraphicsContextGLProxy functions.
    WebGLRenderingContextBase would call as follows:
    void WebGLRenderingContextBase::paintRenderingResultsToCanvas()
    {
        if (isContextLostOrPending())
            return;
        ...
        m_context->prepareForDisplay();
        ...
        m_context->paintCompositedResultsToCanvas();
    }

    The context may be ok during the first check but then fail later,
    and so all the context functions need to check for validity.

    No new tests, testing hooks need non-trivial implementation.
    This is tracked in bug 237891.

    * WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp:
    (WebKit::RemoteGraphicsContextGLProxy::paintRenderingResultsToCanvas):
    (WebKit::RemoteGraphicsContextGLProxy::paintCompositedResultsToCanvas):
    (WebKit::RemoteGraphicsContextGLProxy::copyTextureFromMedia):

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

Modified Paths

Diff

Modified: branches/safari-614.1.6-branch/Source/WebKit/ChangeLog (291409 => 291410)


--- branches/safari-614.1.6-branch/Source/WebKit/ChangeLog	2022-03-17 15:24:31 UTC (rev 291409)
+++ branches/safari-614.1.6-branch/Source/WebKit/ChangeLog	2022-03-17 15:45:29 UTC (rev 291410)
@@ -1,3 +1,68 @@
+2022-03-17  Russell Epstein  <[email protected]>
+
+        Cherry-pick r291314. rdar://problem/90245766
+
+    RemoteGraphicsContextGLProxy omits context lost checks for back and front buffer access functions
+    https://bugs.webkit.org/show_bug.cgi?id=237891
+    
+    Patch by Kimmo Kinnunen <[email protected]> on 2022-03-15
+    Reviewed by Myles Maxfield.
+    
+    Add missing isContextLost() checks to RemoteGraphicsContextGLProxy functions.
+    WebGLRenderingContextBase would call as follows:
+    void WebGLRenderingContextBase::paintRenderingResultsToCanvas()
+    {
+        if (isContextLostOrPending())
+            return;
+        ...
+        m_context->prepareForDisplay();
+        ...
+        m_context->paintCompositedResultsToCanvas();
+    }
+    
+    The context may be ok during the first check but then fail later,
+    and so all the context functions need to check for validity.
+    
+    No new tests, testing hooks need non-trivial implementation.
+    This is tracked in bug 237891.
+    
+    * WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp:
+    (WebKit::RemoteGraphicsContextGLProxy::paintRenderingResultsToCanvas):
+    (WebKit::RemoteGraphicsContextGLProxy::paintCompositedResultsToCanvas):
+    (WebKit::RemoteGraphicsContextGLProxy::copyTextureFromMedia):
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@291314 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2022-03-15  Kimmo Kinnunen  <[email protected]>
+
+            RemoteGraphicsContextGLProxy omits context lost checks for back and front buffer access functions
+            https://bugs.webkit.org/show_bug.cgi?id=237891
+
+            Reviewed by Myles Maxfield.
+
+            Add missing isContextLost() checks to RemoteGraphicsContextGLProxy functions.
+            WebGLRenderingContextBase would call as follows:
+            void WebGLRenderingContextBase::paintRenderingResultsToCanvas()
+            {
+                if (isContextLostOrPending())
+                    return;
+                ...
+                m_context->prepareForDisplay();
+                ...
+                m_context->paintCompositedResultsToCanvas();
+            }
+
+            The context may be ok during the first check but then fail later,
+            and so all the context functions need to check for validity.
+
+            No new tests, testing hooks need non-trivial implementation.
+            This is tracked in bug 237891.
+
+            * WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp:
+            (WebKit::RemoteGraphicsContextGLProxy::paintRenderingResultsToCanvas):
+            (WebKit::RemoteGraphicsContextGLProxy::paintCompositedResultsToCanvas):
+            (WebKit::RemoteGraphicsContextGLProxy::copyTextureFromMedia):
+
 2022-03-16  Russell Epstein  <[email protected]>
 
         Cherry-pick r291352. rdar://problem/90271228

Modified: branches/safari-614.1.6-branch/Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp (291409 => 291410)


--- branches/safari-614.1.6-branch/Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp	2022-03-17 15:24:31 UTC (rev 291409)
+++ branches/safari-614.1.6-branch/Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp	2022-03-17 15:45:29 UTC (rev 291410)
@@ -138,6 +138,8 @@
 
 void RemoteGraphicsContextGLProxy::paintRenderingResultsToCanvas(ImageBuffer& buffer)
 {
+    if (isContextLost())
+        return;
     // FIXME: the buffer is "relatively empty" always, but for consistency, we need to ensure
     // no pending operations are targeted for the `buffer`.
     buffer.flushDrawingContext();
@@ -158,6 +160,8 @@
 
 void RemoteGraphicsContextGLProxy::paintCompositedResultsToCanvas(ImageBuffer& buffer)
 {
+    if (isContextLost())
+        return;
     buffer.flushDrawingContext();
     auto sendResult = sendSync(Messages::RemoteGraphicsContextGL::PaintCompositedResultsToCanvas(buffer.renderingResourceIdentifier()), Messages::RemoteGraphicsContextGL::PaintCompositedResultsToCanvas::Reply());
     if (!sendResult) {
@@ -186,6 +190,8 @@
 #if ENABLE(VIDEO)
 bool RemoteGraphicsContextGLProxy::copyTextureFromMedia(MediaPlayer& mediaPlayer, PlatformGLObject texture, GCGLenum target, GCGLint level, GCGLenum internalFormat, GCGLenum format, GCGLenum type, bool premultiplyAlpha, bool flipY)
 {
+    if (isContextLost())
+        return false;
     auto videoFrame = mediaPlayer.videoFrameForCurrentTime();
     // Video in WP while WebGL in GPUP is not supported.
     if (!videoFrame || !is<RemoteVideoFrameProxy>(*videoFrame))
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to