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
Родитель b868cc3d28
Коммит 1985a49b47
2 изменённых файлов: 8 добавлений и 4 удалений

Просмотреть файл

@ -145,6 +145,12 @@ DIBTextureHost::BindTextureSource(CompositableTextureSourceRef& 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);
}

Просмотреть файл

@ -497,10 +497,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) {