Bug 989375 - Fix basic layer readback with SkiaGL canvases. r=gwright, a=1.4+
authorJames Willcox <snorp@snorp.net>
Thu, 10 Apr 2014 14:19:02 -0500
changeset 192743 817c89be31704370d1d43d725faafc22f2d94758
parent 192742 0091571508ab12a8e0c1647d654885c5260f8cc3
child 192744 4518ab9c258767ca84b0cec9489eb8c2fd21a99f
push id474
push userasasaki@mozilla.com
push dateMon, 02 Jun 2014 21:01:02 +0000
treeherdermozilla-release@967f4cf1b31c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgwright, 1
bugs989375
milestone30.0a2
Bug 989375 - Fix basic layer readback with SkiaGL canvases. r=gwright, a=1.4+
gfx/layers/CopyableCanvasLayer.cpp
--- a/gfx/layers/CopyableCanvasLayer.cpp
+++ b/gfx/layers/CopyableCanvasLayer.cpp
@@ -92,17 +92,23 @@ CopyableCanvasLayer::UpdateTarget(DrawTa
     PaintWithOpacity(aDestTarget, 1.0f, aMaskSurface);
     return;
   }
 
   if (mGLContext) {
     RefPtr<DataSourceSurface> readSurf;
     RefPtr<SourceSurface> 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;
     }
 
     IntSize readSize(sharedSurf->Size());
     SurfaceFormat format = (GetContentFlags() & CONTENT_OPAQUE)
                             ? SurfaceFormat::B8G8R8X8