Bug 1012740 - Change as not to abort in GrallocTextureHostOGL::GrallocTextureHostOGL() r=nical

This commit is contained in:
Sotaro Ikeda
2014-05-22 06:23:12 -07:00
parent 63b044efc4
commit 9596e36b59

View File

@@ -285,18 +285,20 @@ GrallocTextureHostOGL::GrallocTextureHostOGL(TextureFlags aFlags,
const NewSurfaceDescriptorGralloc& aDescriptor)
: TextureHost(aFlags)
{
gfx::SurfaceFormat format = gfx::SurfaceFormat::UNKNOWN;
mGrallocHandle = aDescriptor;
android::GraphicBuffer* graphicBuffer = GetGraphicBufferFromDesc(mGrallocHandle).get();
if (!graphicBuffer) {
NS_RUNTIMEABORT("Invalid SurfaceDescriptor passed in");
}
MOZ_ASSERT(graphicBuffer);
mSize = aDescriptor.size();
gfx::SurfaceFormat format =
SurfaceFormatForAndroidPixelFormat(graphicBuffer->getPixelFormat(),
aFlags & TextureFlags::RB_SWAPPED);
if (graphicBuffer) {
format =
SurfaceFormatForAndroidPixelFormat(graphicBuffer->getPixelFormat(),
aFlags & TextureFlags::RB_SWAPPED);
} else {
NS_WARNING("gralloc buffer is nullptr");
}
mTextureSource = new GrallocTextureSourceOGL(nullptr,
graphicBuffer,
format);