Bug 1145981 - Backout, missing review
authorNicolas Silva <nsilva@mozilla.com>
Fri, 27 Mar 2015 11:19:22 +0100
changeset 264951 0e0e159457ec700aae5bb661a392c6ee2a915c05
parent 264950 a626cde311154c6f9b5dd8312b2d4a57ae18e2f3
child 264952 eaf2526ffd900b4bbe0572f55d590962f5896e39
push id4718
push userraliiev@mozilla.com
push dateMon, 11 May 2015 18:39:53 +0000
treeherdermozilla-beta@c20c4ef55f08 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1145981
milestone39.0a1
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
Bug 1145981 - Backout, missing review
gfx/layers/TextureDIB.cpp
gfx/layers/composite/TextureHost.cpp
--- a/gfx/layers/TextureDIB.cpp
+++ b/gfx/layers/TextureDIB.cpp
@@ -140,22 +140,16 @@ DIBTextureHost::BindTextureSource(Compos
 
   aTexture = mTextureSource;
   return !!aTexture;
 }
 
 void
 DIBTextureHost::Updated(const nsIntRegion* aRegion)
 {
-  if (!mCompositor) {
-    // This can happen if we send textures to a compositable that isn't yet
-    // attached to a layer.
-    return;
-  }
-
   if (!mTextureSource) {
     mTextureSource = mCompositor->CreateDataTextureSource(mFlags);
   }
 
   nsRefPtr<gfxImageSurface> imgSurf = mSurface->GetAsImageSurface();
 
   RefPtr<DataSourceSurface> surf = Factory::CreateWrappingDataSourceSurface(imgSurf->Data(), imgSurf->Stride(), mSize, mFormat);
 
--- a/gfx/layers/composite/TextureHost.cpp
+++ b/gfx/layers/composite/TextureHost.cpp
@@ -492,18 +492,20 @@ BufferTextureHost::Upload(nsIntRegion *a
 {
   if (!GetBuffer()) {
     // We don't have a buffer; a possible cause is that the IPDL actor
     // is already dead. This inevitably happens as IPDL actors can die
     // at any time, so we want to silently return in this case.
     return false;
   }
   if (!mCompositor) {
-    // This can happen if we send textures to a compositable that isn't yet
-    // attached to a layer.
+    NS_WARNING("Tried to upload without a compositor. Skipping texture upload...");
+    // If we are in this situation it means we should have called SetCompositor
+    // earlier. It is conceivable that on certain rare conditions with async-video
+    // we may end up here for the first frame, but this should not happen repeatedly.
     return false;
   }
   if (mFormat == gfx::SurfaceFormat::UNKNOWN) {
     NS_WARNING("BufferTextureHost: unsupported format!");
     return false;
   } else if (mFormat == gfx::SurfaceFormat::YUV) {
     YCbCrImageDataDeserializer yuvDeserializer(GetBuffer(), GetBufferSize());
     MOZ_ASSERT(yuvDeserializer.IsValid());