Backed out changeset 6846b610be41 (bug 897409) for suspicion of making Win8 mochitest-mc perma-orange.
authorRyan VanderMeulen <ryanvm@gmail.com>
Tue, 30 Jul 2013 22:28:46 -0400
changeset 152969 7656ce2cd32952dc09fa03abcca60a8f49a7d189
parent 152968 a9e41a4c4ee4a65f5208c67a93e8f9319b12f360
child 152972 71b1da3303e523ef200220642bba11a5d7e0d528
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs897409
milestone25.0a1
backs out6846b610be41890f6ec26a6a71ed01abb252a31d
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 6846b610be41 (bug 897409) for suspicion of making Win8 mochitest-mc perma-orange.
gfx/layers/CopyableCanvasLayer.cpp
gfx/layers/client/CanvasClient.cpp
--- a/gfx/layers/CopyableCanvasLayer.cpp
+++ b/gfx/layers/CopyableCanvasLayer.cpp
@@ -69,33 +69,38 @@ CopyableCanvasLayer::UpdateSurface(gfxAS
   if (!mGLContext && aDestSurface) {
     nsRefPtr<gfxContext> tmpCtx = new gfxContext(aDestSurface);
     tmpCtx->SetOperator(gfxContext::OPERATOR_SOURCE);
     CopyableCanvasLayer::PaintWithOpacity(tmpCtx, 1.0f, aMaskLayer);
     return;
   }
 
   if (mGLContext) {
+    if (aDestSurface && aDestSurface->GetType() != gfxASurface::SurfaceTypeImage) {
+      MOZ_ASSERT(false, "Destination surface must be ImageSurface type.");
+      return;
+    }
+
     nsRefPtr<gfxImageSurface> readSurf;
     nsRefPtr<gfxImageSurface> resultSurf;
 
     SharedSurface* sharedSurf = mGLContext->RequestFrame();
     if (!sharedSurf) {
       NS_WARNING("Null frame received.");
       return;
     }
 
     gfxIntSize readSize(sharedSurf->Size());
     gfxImageFormat format = (GetContentFlags() & CONTENT_OPAQUE)
                             ? gfxASurface::ImageFormatRGB24
                             : gfxASurface::ImageFormatARGB32;
 
-    bool needsTempSurface = !aDestSurface ||
-                            !(resultSurf = aDestSurface->GetAsImageSurface());
-    if (needsTempSurface) {
+    if (aDestSurface) {
+      resultSurf = static_cast<gfxImageSurface*>(aDestSurface);
+    } else {
       resultSurf = GetTempSurface(readSize, format);
     }
     MOZ_ASSERT(resultSurf);
     if (resultSurf->CairoStatus() != 0) {
       MOZ_ASSERT(false, "Bad resultSurf->CairoStatus().");
       return;
     }
 
@@ -146,17 +151,17 @@ CopyableCanvasLayer::UpdateSurface(gfxAS
       readSurf->Flush();
       nsRefPtr<gfxContext> ctx = new gfxContext(resultSurf);
       ctx->SetOperator(gfxContext::OPERATOR_SOURCE);
       ctx->SetSource(readSurf);
       ctx->Paint();
     }
 
     // stick our surface into mSurface, so that the Paint() path is the same
-    if (needsTempSurface) {
+    if (!aDestSurface) {
       mSurface = resultSurf;
     }
   }
 }
 
 void
 CopyableCanvasLayer::PaintWithOpacity(gfxContext* aContext,
                                       float aOpacity,
--- a/gfx/layers/client/CanvasClient.cpp
+++ b/gfx/layers/client/CanvasClient.cpp
@@ -61,17 +61,17 @@ CanvasClient2D::Update(gfx::IntSize aSiz
   }
 
   bool isOpaque = (aLayer->GetContentFlags() & Layer::CONTENT_OPAQUE);
   gfxASurface::gfxContentType contentType = isOpaque
                                               ? gfxASurface::CONTENT_COLOR
                                               : gfxASurface::CONTENT_COLOR_ALPHA;
   mDeprecatedTextureClient->EnsureAllocated(aSize, contentType);
 
-  gfxASurface* surface = mDeprecatedTextureClient->LockSurface();
+  gfxASurface* surface = mDeprecatedTextureClient->LockImageSurface();
   aLayer->UpdateSurface(surface);
   mDeprecatedTextureClient->Unlock();
 }
 
 void
 CanvasClientWebGL::Updated()
 {
   mForwarder->UpdateTextureNoSwap(this, 1, mDeprecatedTextureClient->GetDescriptor());