Bug 912173 - Always AddRef and Release the GLContext when sharing a SurfaceStream to avoid mismatches. r=nrc

This commit is contained in:
Matt Woodrow 2013-09-09 14:35:20 +12:00
Родитель 83ca0489b5
Коммит fa8f16578a
2 изменённых файлов: 8 добавлений и 15 удалений

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

@ -206,17 +206,13 @@ DeprecatedCanvasClientSurfaceStream::Update(gfx::IntSize aSize, ClientCanvasLaye
#endif
} else {
SurfaceStreamHandle handle = stream->GetShareHandle();
SurfaceDescriptor *desc = mDeprecatedTextureClient->GetDescriptor();
if (desc->type() != SurfaceDescriptor::TSurfaceStreamDescriptor ||
desc->get_SurfaceStreamDescriptor().handle() != handle) {
*desc = SurfaceStreamDescriptor(handle, false);
mDeprecatedTextureClient->SetDescriptor(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();
}
// Bug 894405
//
// Ref this so the SurfaceStream doesn't disappear unexpectedly. The
// Compositor will need to unref it when finished.
aLayer->mGLContext->AddRef();
}
aLayer->Painted();

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

@ -640,11 +640,8 @@ SurfaceStreamHostOGL::UpdateImpl(const SurfaceDescriptor& aImage,
const SurfaceStreamDescriptor& streamDesc =
aImage.get_SurfaceStreamDescriptor();
SurfaceStream *stream = SurfaceStream::FromHandle(streamDesc.handle());
if (stream == mStream) {
return;
}
mStream = stream;
mStream = SurfaceStream::FromHandle(streamDesc.handle());
MOZ_ASSERT(mStream);
mStreamGL = dont_AddRef(mStream->GLContext());
}