Bug 1145981 - Do not crash when a DIB texture is updated without a compositor. r=jrmuizel

This commit is contained in:
Nicolas Silva 2015-03-27 11:16:27 +01:00
parent 89a3e0bb4a
commit f260783897
2 changed files with 8 additions and 4 deletions

View File

@ -144,6 +144,12 @@ DIBTextureHost::GetTextureSources()
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);
}

View File

@ -503,10 +503,8 @@ BufferTextureHost::Upload(nsIntRegion *aRegion)
return false;
}
if (!mCompositor) {
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.
// This can happen if we send textures to a compositable that isn't yet
// attached to a layer.
return false;
}
if (mFormat == gfx::SurfaceFormat::UNKNOWN) {