зеркало из https://github.com/mozilla/gecko-dev.git
Bug 776876 - msvc nullptr fix for GLContextProviderEGL. r=joe
This commit is contained in:
Родитель
3ef32d7194
Коммит
532a8fed99
|
@ -888,10 +888,10 @@ SharedTextureHandle
|
|||
GLContextEGL::CreateSharedHandle(TextureImage::TextureShareType aType)
|
||||
{
|
||||
if (aType != TextureImage::ThreadShared)
|
||||
return nsnull;
|
||||
return 0;
|
||||
|
||||
if (!mShareWithEGLImage)
|
||||
return nsnull;
|
||||
return 0;
|
||||
|
||||
MakeCurrent();
|
||||
GLuint texture = 0;
|
||||
|
@ -903,7 +903,7 @@ GLContextEGL::CreateSharedHandle(TextureImage::TextureShareType aType)
|
|||
if (!tex->CreateEGLImage()) {
|
||||
NS_ERROR("EGLImage creation for EGLTextureWrapper failed");
|
||||
ReleaseSharedHandle(aType, (SharedTextureHandle)tex);
|
||||
return nsnull;
|
||||
return 0;
|
||||
}
|
||||
// Raw pointer shared across threads
|
||||
return (SharedTextureHandle)tex;
|
||||
|
@ -917,35 +917,35 @@ GLContextEGL::CreateSharedHandle(TextureImage::TextureShareType aType,
|
|||
// Both EGLImage and SurfaceTexture only support ThreadShared currently, but
|
||||
// it's possible to make SurfaceTexture work across processes. We should do that.
|
||||
if (aType != TextureImage::ThreadShared)
|
||||
return nsnull;
|
||||
return 0;
|
||||
|
||||
switch (aBufferType) {
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
case SharedTextureBufferType::SurfaceTexture:
|
||||
if (!IsExtensionSupported(GLContext::OES_EGL_image_external)) {
|
||||
NS_WARNING("Missing GL_OES_EGL_image_external");
|
||||
return nsnull;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return (SharedTextureHandle) new SurfaceTextureWrapper(reinterpret_cast<nsSurfaceTexture*>(aBuffer));
|
||||
#endif
|
||||
case SharedTextureBufferType::TextureID: {
|
||||
if (!mShareWithEGLImage)
|
||||
return nsnull;
|
||||
return 0;
|
||||
|
||||
GLuint texture = (GLuint)aBuffer;
|
||||
EGLTextureWrapper* tex = new EGLTextureWrapper(this, texture, false);
|
||||
if (!tex->CreateEGLImage()) {
|
||||
NS_ERROR("EGLImage creation for EGLTextureWrapper failed");
|
||||
delete tex;
|
||||
return nsnull;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return (SharedTextureHandle)tex;
|
||||
}
|
||||
default:
|
||||
NS_ERROR("Unknown shared texture buffer type");
|
||||
return nsnull;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче