diff --git a/gfx/layers/CopyableCanvasLayer.cpp b/gfx/layers/CopyableCanvasLayer.cpp index da759893ebf2..f438ad953a2c 100644 --- a/gfx/layers/CopyableCanvasLayer.cpp +++ b/gfx/layers/CopyableCanvasLayer.cpp @@ -99,7 +99,13 @@ CopyableCanvasLayer::UpdateTarget(DrawTarget* aDestTarget) RefPtr readSurf; RefPtr resultSurf; - SharedSurface_GL* sharedSurf = mGLContext->RequestFrame(); + SharedSurface_GL* sharedSurf = nullptr; + if (mStream) { + sharedSurf = SharedSurface_GL::Cast(mStream->SwapConsumer()); + } else { + sharedSurf = mGLContext->RequestFrame(); + } + if (!sharedSurf) { NS_WARNING("Null frame received."); return;