Bug 692458 - Fix for GLContext currency error - r=bjacob
authorJeff Gilbert <jgilbert@mozilla.com>
Fri, 07 Oct 2011 15:16:48 -0400
changeset 78829 4a6cfa62d84542119c1ba72968b6c967b1057956
parent 78828 198dbe19cfaa8f5ba2ebed179cd554cdd68b0d85
child 78830 500185b5808c116c77c43a943bc349e7a4f7ad0b
push idunknown
push userunknown
push dateunknown
reviewersbjacob
bugs692458
milestone10.0a1
Bug 692458 - Fix for GLContext currency error - r=bjacob
gfx/layers/d3d10/CanvasLayerD3D10.cpp
gfx/layers/d3d9/CanvasLayerD3D9.cpp
--- a/gfx/layers/d3d10/CanvasLayerD3D10.cpp
+++ b/gfx/layers/d3d10/CanvasLayerD3D10.cpp
@@ -174,16 +174,18 @@ CanvasLayerD3D10::UpdateSurface()
 
     PRUint8 *destination;
     if (map.RowPitch != mBounds.width * 4) {
       destination = new PRUint8[mBounds.width * mBounds.height * 4];
     } else {
       destination = (PRUint8*)map.pData;
     }
 
+    mGLContext->MakeCurrent();
+
     // We have to flush to ensure that any buffered GL operations are
     // in the framebuffer before we read.
     mGLContext->fFlush();
 
     PRUint32 currentFramebuffer = 0;
 
     mGLContext->fGetIntegerv(LOCAL_GL_FRAMEBUFFER_BINDING, (GLint*)&currentFramebuffer);
 
--- a/gfx/layers/d3d9/CanvasLayerD3D9.cpp
+++ b/gfx/layers/d3d9/CanvasLayerD3D9.cpp
@@ -108,16 +108,18 @@ CanvasLayerD3D9::UpdateSurface()
 
     PRUint8 *destination;
     if (r.Pitch != mBounds.width * 4) {
       destination = new PRUint8[mBounds.width * mBounds.height * 4];
     } else {
       destination = (PRUint8*)r.pBits;
     }
 
+    mGLContext->MakeCurrent();
+
     // We have to flush to ensure that any buffered GL operations are
     // in the framebuffer before we read.
     mGLContext->fFlush();
 
     PRUint32 currentFramebuffer = 0;
 
     mGLContext->fGetIntegerv(LOCAL_GL_FRAMEBUFFER_BINDING, (GLint*)&currentFramebuffer);