diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-03-15 09:11:31 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-03-15 09:11:31 +0100 |
commit | 82b361dc4463b13ebda30090e239db487f5aa308 (patch) | |
tree | fdc6fd06e695188735d636da57b02b6c7e0c1c5f /gfx/layers/opengl | |
parent | 4bb98e2b61ce75d7f5d19398b658441a7ceed04b (diff) | |
parent | 71429dc7ecc496c5924c770746e8c28449ecb7a2 (diff) | |
download | UXP-82b361dc4463b13ebda30090e239db487f5aa308.tar UXP-82b361dc4463b13ebda30090e239db487f5aa308.tar.gz UXP-82b361dc4463b13ebda30090e239db487f5aa308.tar.lz UXP-82b361dc4463b13ebda30090e239db487f5aa308.tar.xz UXP-82b361dc4463b13ebda30090e239db487f5aa308.zip |
Merge branch 'ported-upstream'
Diffstat (limited to 'gfx/layers/opengl')
-rw-r--r-- | gfx/layers/opengl/MacIOSurfaceTextureHostOGL.cpp | 8 | ||||
-rw-r--r-- | gfx/layers/opengl/TextureHostOGL.cpp | 23 |
2 files changed, 12 insertions, 19 deletions
diff --git a/gfx/layers/opengl/MacIOSurfaceTextureHostOGL.cpp b/gfx/layers/opengl/MacIOSurfaceTextureHostOGL.cpp index 05f8cf38f..9736618f7 100644 --- a/gfx/layers/opengl/MacIOSurfaceTextureHostOGL.cpp +++ b/gfx/layers/opengl/MacIOSurfaceTextureHostOGL.cpp @@ -28,6 +28,8 @@ MacIOSurfaceTextureHostOGL::~MacIOSurfaceTextureHostOGL() GLTextureSource* MacIOSurfaceTextureHostOGL::CreateTextureSourceForPlane(size_t aPlane) { + MOZ_ASSERT(mSurface); + GLuint textureHandle; gl::GLContext* gl = mCompositor->gl(); gl->fGenTextures(1, &textureHandle); @@ -84,11 +86,17 @@ MacIOSurfaceTextureHostOGL::SetCompositor(Compositor* aCompositor) gfx::SurfaceFormat MacIOSurfaceTextureHostOGL::GetFormat() const { + if (!mSurface) { + return gfx::SurfaceFormat::UNKNOWN; + } return mSurface->GetFormat(); } gfx::SurfaceFormat MacIOSurfaceTextureHostOGL::GetReadFormat() const { + if (!mSurface) { + return gfx::SurfaceFormat::UNKNOWN; + } return mSurface->GetReadFormat(); } diff --git a/gfx/layers/opengl/TextureHostOGL.cpp b/gfx/layers/opengl/TextureHostOGL.cpp index 854160bc6..02c398b51 100644 --- a/gfx/layers/opengl/TextureHostOGL.cpp +++ b/gfx/layers/opengl/TextureHostOGL.cpp @@ -25,10 +25,6 @@ #include "mozilla/layers/MacIOSurfaceTextureHostOGL.h" #endif -#ifdef GL_PROVIDER_GLX -#include "mozilla/layers/X11TextureHost.h" -#endif - using namespace mozilla::gl; using namespace mozilla::gfx; @@ -44,12 +40,6 @@ CreateTextureHostOGL(const SurfaceDescriptor& aDesc, { RefPtr<TextureHost> result; switch (aDesc.type()) { - case SurfaceDescriptor::TSurfaceDescriptorBuffer: { - result = CreateBackendIndependentTextureHost(aDesc, - aDeallocator, aFlags); - break; - } - #ifdef MOZ_WIDGET_ANDROID case SurfaceDescriptor::TSurfaceTextureDescriptor: { const SurfaceTextureDescriptor& desc = aDesc.get_SurfaceTextureDescriptor(); @@ -79,14 +69,6 @@ CreateTextureHostOGL(const SurfaceDescriptor& aDesc, } #endif -#ifdef GL_PROVIDER_GLX - case SurfaceDescriptor::TSurfaceDescriptorX11: { - const auto& desc = aDesc.get_SurfaceDescriptorX11(); - result = new X11TextureHost(aFlags, desc); - break; - } -#endif - case SurfaceDescriptor::TSurfaceDescriptorSharedGLTexture: { const auto& desc = aDesc.get_SurfaceDescriptorSharedGLTexture(); result = new GLTextureHost(aFlags, desc.texture(), @@ -96,7 +78,10 @@ CreateTextureHostOGL(const SurfaceDescriptor& aDesc, desc.hasAlpha()); break; } - default: return nullptr; + default: { + MOZ_ASSERT_UNREACHABLE("Unsupported SurfaceDescriptor type"); + break; + } } return result.forget(); } |