Skip to content

Commit

Permalink
Call prepareForDisplayWithPaint so that WebGL buffers get cleared.
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=244877

Reviewed by Chris Lord.

WebGLRenderingContextBase needs this to be called, so that paintRenderingResultsToCanvas()
knows that this is a 'display' and clears the back buffer.

* Source/WebCore/html/OffscreenCanvas.cpp:
(WebCore::OffscreenCanvas::commitToPlaceholderCanvas):

Canonical link: https://commits.webkit.org/254259@main
  • Loading branch information
mattwoodrow committed Sep 8, 2022
1 parent 74baf93 commit 0f38a84
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Source/WebCore/html/OffscreenCanvas.cpp
Expand Up @@ -447,8 +447,10 @@ void OffscreenCanvas::commitToPlaceholderCanvas()
return;

// FIXME: Transfer texture over if we're using accelerated compositing
if (m_context && (m_context->isWebGL() || m_context->isAccelerated()))
if (m_context && (m_context->isWebGL() || m_context->isAccelerated())) {
m_context->prepareForDisplayWithPaint();
m_context->paintRenderingResultsToCanvas();
}

if (m_placeholderData->bufferPipeSource) {
if (auto bufferCopy = imageBuffer->clone())
Expand Down

0 comments on commit 0f38a84

Please sign in to comment.