Bug 774688 - Mark reused buffer as dirty in BasicCanvasLayer - r=bas
authorJeff Gilbert <jgilbert@mozilla.com>
Tue, 17 Jul 2012 21:27:49 -0700
changeset 99627 cedfa313d168433bf943734078506c811a22cb84
parent 99626 08b872de0676a93f22e074edcc9cfd3fcd46851d
child 99628 58525c0d69f24a7b1bfd59f97efb33c9466bab05
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersbas
bugs774688
milestone17.0a1
Bug 774688 - Mark reused buffer as dirty in BasicCanvasLayer - r=bas
gfx/layers/basic/BasicCanvasLayer.cpp
--- a/gfx/layers/basic/BasicCanvasLayer.cpp
+++ b/gfx/layers/basic/BasicCanvasLayer.cpp
@@ -176,19 +176,22 @@ BasicCanvasLayer::UpdateSurface(gfxASurf
 
     mGLContext->fGetIntegerv(LOCAL_GL_FRAMEBUFFER_BINDING, (GLint*)&currentFramebuffer);
 
     // Make sure that we read pixels from the correct framebuffer, regardless
     // of what's currently bound.
     if (currentFramebuffer != mCanvasFramebuffer)
       mGLContext->fBindFramebuffer(LOCAL_GL_FRAMEBUFFER, mCanvasFramebuffer);
 
+    // We need to Flush() the surface before modifying it outside of cairo.
+    isurf->Flush();
     mGLContext->ReadPixelsIntoImageSurface(0, 0,
                                            mBounds.width, mBounds.height,
                                            isurf);
+    isurf->MarkDirty();
 
     // Put back the previous framebuffer binding.
     if (currentFramebuffer != mCanvasFramebuffer)
       mGLContext->fBindFramebuffer(LOCAL_GL_FRAMEBUFFER, currentFramebuffer);
 
     // If the underlying GLContext doesn't have a framebuffer into which
     // premultiplied values were written, we have to do this ourselves here.
     // Note that this is a WebGL attribute; GL itself has no knowledge of