Bug 1349067 - Make gl as current at WebGL2 ReadBuffer(); r=ethlin,jgilbert
authorDaosheng Mu <daoshengmu@gmail.com>
Tue, 28 Mar 2017 00:05:37 +0800
changeset 428128 38aba5843d79d421d1082bcde16d5d2124f689c3
parent 428127 9f517e50e6ecbaf91686d7174651c2c838ccf5ba
child 428129 e46e58f218bd3791835abde0008201fdf3b169a9
push id97
push userfmarier@mozilla.com
push dateSat, 14 Oct 2017 01:12:59 +0000
reviewersethlin, jgilbert
bugs1349067
milestone58.0a1
Bug 1349067 - Make gl as current at WebGL2 ReadBuffer(); r=ethlin,jgilbert MozReview-Commit-ID: 5yrsuhilb1N
dom/canvas/WebGL2ContextFramebuffers.cpp
--- a/dom/canvas/WebGL2ContextFramebuffers.cpp
+++ b/dom/canvas/WebGL2ContextFramebuffers.cpp
@@ -311,16 +311,18 @@ WebGL2Context::InvalidateSubFramebuffer(
 
 void
 WebGL2Context::ReadBuffer(GLenum mode)
 {
     const char funcName[] = "readBuffer";
     if (IsContextLost())
         return;
 
+    gl->MakeCurrent();
+
     if (mBoundReadFramebuffer) {
         mBoundReadFramebuffer->ReadBuffer(funcName, mode);
         return;
     }
 
     // Operating on the default framebuffer.
     if (mode != LOCAL_GL_NONE &&
         mode != LOCAL_GL_BACK)