Bug 1251726 - Check if Compositor is set r=nical
authorSotaro Ikeda <sotaro.ikeda.g@gmail.com>
Mon, 07 Mar 2016 17:35:38 -0800
changeset 338026 185e10fbb9d31096a19b2ed14dd19c4246cc043c
parent 338025 396e7cdc25393a818a8e3a07af49284655ad58a3
child 338027 7a02a813a179bcd9a1e0640c0177377aa565e2e7
push id12405
push usercku@mozilla.com
push dateTue, 08 Mar 2016 03:35:29 +0000
reviewersnical
bugs1251726
milestone47.0a1
Bug 1251726 - Check if Compositor is set r=nical
gfx/layers/composite/TextureHost.cpp
--- a/gfx/layers/composite/TextureHost.cpp
+++ b/gfx/layers/composite/TextureHost.cpp
@@ -538,19 +538,21 @@ BufferTextureHost::PrepareTextureSource(
 
   // We don't own it, apparently.
   mFirstSource = nullptr;
 
   DataTextureSource* texture = aTexture.get() ? aTexture->AsDataTextureSource() : nullptr;
   bool compatibleFormats = texture
                          && (mFormat == texture->GetFormat()
                              || (mFormat == gfx::SurfaceFormat::YUV
+                                 && mCompositor
                                  && mCompositor->SupportsEffect(EffectTypes::YCBCR)
                                  && texture->GetNextSibling())
                              || (mFormat == gfx::SurfaceFormat::YUV
+                                 && mCompositor
                                  && !mCompositor->SupportsEffect(EffectTypes::YCBCR)
                                  && texture->GetFormat() == gfx::SurfaceFormat::B8G8R8X8));
 
   bool shouldCreateTexture = !compatibleFormats
                            || texture->NumCompositableRefs() > 1
                            || texture->HasOwner()
                            || texture->GetSize() != mSize;