Backed out changeset a111e4aa24ad (bug 904620) for Android reftest-2 crashes. a=backout
authorRyan VanderMeulen <ryanvm@gmail.com>
Wed, 25 Sep 2013 12:24:00 -0400
changeset 186024 6f8b48123dc4626fd83ebc8fdf783c6fd7699f0c
parent 186023 a111e4aa24ad5229946103e6d77780f680a7afbb
child 186025 d1d4f379db2095414eadbcac022a480de2845b01
push id6
push userryanvm@gmail.com
push dateMon, 28 Apr 2014 19:04:19 +0000
treeherdermozilla-b2g30_v1_4@129018b8b543 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs904620
milestone25.0
backs outa111e4aa24ad5229946103e6d77780f680a7afbb
Backed out changeset a111e4aa24ad (bug 904620) for Android reftest-2 crashes. a=backout DONTBUILD
gfx/layers/client/CanvasClient.cpp
gfx/layers/client/CanvasClient.h
gfx/layers/opengl/TextureHostOGL.cpp
--- a/gfx/layers/client/CanvasClient.cpp
+++ b/gfx/layers/client/CanvasClient.cpp
@@ -116,23 +116,27 @@ DeprecatedCanvasClient2D::Update(gfx::In
   gfxASurface* surface = mDeprecatedTextureClient->LockSurface();
   aLayer->UpdateSurface(surface);
   mDeprecatedTextureClient->Unlock();
 }
 
 void
 DeprecatedCanvasClientSurfaceStream::Updated()
 {
-  mForwarder->UpdateTextureNoSwap(this, 1, mDeprecatedTextureClient->GetDescriptor());
+  if (mNeedsUpdate) {
+    mForwarder->UpdateTextureNoSwap(this, 1, mDeprecatedTextureClient->GetDescriptor());
+    mNeedsUpdate = false;
+  }
 }
 
 
 DeprecatedCanvasClientSurfaceStream::DeprecatedCanvasClientSurfaceStream(CompositableForwarder* aFwd,
                                                                          TextureFlags aFlags)
 : CanvasClient(aFwd, aFlags)
+, mNeedsUpdate(false)
 {
   mTextureInfo.mCompositableType = BUFFER_IMAGE_SINGLE;
 }
 
 void
 DeprecatedCanvasClientSurfaceStream::Update(gfx::IntSize aSize, ClientCanvasLayer* aLayer)
 {
   if (!mDeprecatedTextureClient) {
@@ -164,28 +168,30 @@ DeprecatedCanvasClientSurfaceStream::Upd
     }
 
     SharedSurface_Gralloc* grallocSurf = SharedSurface_Gralloc::Cast(surf);
     mDeprecatedTextureClient->SetDescriptor(grallocSurf->GetDescriptor());
 #else
     printf_stderr("isCrossProcess, but not MOZ_WIDGET_GONK! Someone needs to write some code!");
     MOZ_ASSERT(false);
 #endif
+    mNeedsUpdate = true;
   } else {
     SurfaceStreamHandle handle = stream->GetShareHandle();
     SurfaceDescriptor *desc = mDeprecatedTextureClient->GetDescriptor();
     if (desc->type() != SurfaceDescriptor::TSurfaceStreamDescriptor ||
         desc->get_SurfaceStreamDescriptor().handle() != handle) {
       *desc = SurfaceStreamDescriptor(handle, false);
 
       // Bug 894405
       //
       // Ref this so the SurfaceStream doesn't disappear unexpectedly. The
       // Compositor will need to unref it when finished.
       aLayer->mGLContext->AddRef();
+      mNeedsUpdate = true;
     }
   }
 
   aLayer->Painted();
 }
 
 }
 }
--- a/gfx/layers/client/CanvasClient.h
+++ b/gfx/layers/client/CanvasClient.h
@@ -127,14 +127,15 @@ public:
   virtual void SetDescriptorFromReply(TextureIdentifier aTextureId,
                                       const SurfaceDescriptor& aDescriptor) MOZ_OVERRIDE
   {
     mDeprecatedTextureClient->SetDescriptorFromReply(aDescriptor);
   }
 
 private:
   RefPtr<DeprecatedTextureClient> mDeprecatedTextureClient;
+  bool mNeedsUpdate;
 };
 
 }
 }
 
 #endif
--- a/gfx/layers/opengl/TextureHostOGL.cpp
+++ b/gfx/layers/opengl/TextureHostOGL.cpp
@@ -604,21 +604,17 @@ SurfaceStreamHostOGL::UpdateImpl(const S
 
   // Bug 894405
   //
   // The SurfaceStream's GLContext was refed before being passed up to us, so
   // we need to ensure it gets unrefed when we are finished.
   const SurfaceStreamDescriptor& streamDesc =
       aImage.get_SurfaceStreamDescriptor();
 
-  SurfaceStream *stream = SurfaceStream::FromHandle(streamDesc.handle());
-  if (stream == mStream) {
-    return;
-  }
-  mStream = stream;
+  mStream = SurfaceStream::FromHandle(streamDesc.handle());
   MOZ_ASSERT(mStream);
   mStreamGL = dont_AddRef(mStream->GLContext());
 }
 
 void
 SurfaceStreamHostOGL::Unlock()
 {
   // We don't know what this is unless we're locked