Skip to content

Commit

Permalink
Cherry-pick 18019ce. rdar://122471664
Browse files Browse the repository at this point in the history
    Canvas captureStream produces stuttering with WebGL
    https://bugs.webkit.org/show_bug.cgi?id=268613
    rdar://122619662

    Reviewed by Youenn Fablet.

    GraphicsContextGLCocoa::surfaceBufferToVideoFrame() will access the
    display buffer IOSurface. The display buffer drawing must be scheduled
    to Metal before this happens.

    EGL_ReleaseTexImage() in bindNextDrawingBuffer used to ensure this, due
    to ReleaseTexImage being specified as inducing a flush.

    ANGLE changed flush semantics so that it does not wait until the
    commands are scheduled. Thus long running WebGL could be left
    unscheduled at the display buffer read for MSE capture track.

    Fix by ensuring the display buffer commands are scheduled during
    prepare, as is the intention.

    * Source/WebCore/platform/graphics/cocoa/GraphicsContextGLCocoa.mm:
    (WebCore::GraphicsContextGLCocoa::prepareForDisplayWithFinishedSignal):

    Canonical link: https://commits.webkit.org/274454@main

Identifier: 272448.559@safari-7618-branch
  • Loading branch information
kkinnunen-apple authored and Dan Robson committed Feb 13, 2024
1 parent b649c93 commit bc12a40
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -764,12 +764,10 @@ static bool needsEAGLOnMac()
prepareTexture();
// The fence inserted by this will be scheduled because next BindTexImage will wait until scheduled.
insertFinishedSignalOrInvoke(WTFMove(finishedSignal));
if (!bindNextDrawingBuffer()) {
// If the allocation failed, BindTexImage did not run. The fence must be scheduled.
waitUntilWorkScheduled();
bool success = bindNextDrawingBuffer();
waitUntilWorkScheduled();
if (!success)
forceContextLost();
return;
}
}


Expand Down

0 comments on commit bc12a40

Please sign in to comment.