Bug 904620 - Always send a transaction when we get a WebGL update to ensure that we get a composite. r=nrc, a=lsblakk
☠☠ backed out by 6f8b48123dc4 ☠ ☠
authorMatt Woodrow <mwoodrow@mozilla.com>
Tue, 20 Aug 2013 11:39:55 +1200
changeset 186023 a111e4aa24ad5229946103e6d77780f680a7afbb
parent 186022 ac6031737273c3ce7ea36a268581e91902f8472c
child 186024 6f8b48123dc4626fd83ebc8fdf783c6fd7699f0c
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)
reviewersnrc, lsblakk
bugs904620
milestone25.0
Bug 904620 - Always send a transaction when we get a WebGL update to ensure that we get a composite. r=nrc, a=lsblakk
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,27 +116,23 @@ DeprecatedCanvasClient2D::Update(gfx::In
   gfxASurface* surface = mDeprecatedTextureClient->LockSurface();
   aLayer->UpdateSurface(surface);
   mDeprecatedTextureClient->Unlock();
 }
 
 void
 DeprecatedCanvasClientSurfaceStream::Updated()
 {
-  if (mNeedsUpdate) {
-    mForwarder->UpdateTextureNoSwap(this, 1, mDeprecatedTextureClient->GetDescriptor());
-    mNeedsUpdate = false;
-  }
+  mForwarder->UpdateTextureNoSwap(this, 1, mDeprecatedTextureClient->GetDescriptor());
 }
 
 
 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) {
@@ -168,30 +164,28 @@ 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,15 +127,14 @@ 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,17 +604,21 @@ 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();
 
-  mStream = SurfaceStream::FromHandle(streamDesc.handle());
+  SurfaceStream *stream = SurfaceStream::FromHandle(streamDesc.handle());
+  if (stream == mStream) {
+    return;
+  }
+  mStream = stream;
   MOZ_ASSERT(mStream);
   mStreamGL = dont_AddRef(mStream->GLContext());
 }
 
 void
 SurfaceStreamHostOGL::Unlock()
 {
   // We don't know what this is unless we're locked