summaryrefslogtreecommitdiffstats
path: root/gfx/gl/SharedSurfaceIO.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
commit086c044dc34dfc0f74fbe41f4ecb402b2cd34884 (patch)
treea4f824bd33cb075dd5aa3eb5a0a94af221bbe83a /gfx/gl/SharedSurfaceIO.cpp
parentAdding debian version 124.0.1-1. (diff)
downloadfirefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.tar.xz
firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gfx/gl/SharedSurfaceIO.cpp')
-rw-r--r--gfx/gl/SharedSurfaceIO.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/gfx/gl/SharedSurfaceIO.cpp b/gfx/gl/SharedSurfaceIO.cpp
index 1fd0f22d31..459faa64b3 100644
--- a/gfx/gl/SharedSurfaceIO.cpp
+++ b/gfx/gl/SharedSurfaceIO.cpp
@@ -28,7 +28,7 @@ SurfaceFactory_IOSurface::SurfaceFactory_IOSurface(GLContext& gl)
// -
// Surface
-static void BackTextureWithIOSurf(GLContext* const gl, const GLuint tex,
+static bool BackTextureWithIOSurf(GLContext* const gl, const GLuint tex,
MacIOSurface* const ioSurf) {
MOZ_ASSERT(gl->IsCurrent());
@@ -43,10 +43,7 @@ static void BackTextureWithIOSurf(GLContext* const gl, const GLuint tex,
gl->fTexParameteri(LOCAL_GL_TEXTURE_RECTANGLE_ARB, LOCAL_GL_TEXTURE_WRAP_T,
LOCAL_GL_CLAMP_TO_EDGE);
- CGLContextObj cgl = GLContextCGL::Cast(gl)->GetCGLContext();
- MOZ_ASSERT(cgl);
-
- ioSurf->CGLTexImageIOSurface2D(gl, cgl, 0);
+ return ioSurf->BindTexImage(gl, 0);
}
/*static*/
@@ -65,7 +62,9 @@ UniquePtr<SharedSurface_IOSurface> SharedSurface_IOSurface::Create(
// -
auto tex = MakeUnique<Texture>(*desc.gl);
- BackTextureWithIOSurf(desc.gl, tex->name, ioSurf);
+ if (!BackTextureWithIOSurf(desc.gl, tex->name, ioSurf)) {
+ return nullptr;
+ }
const GLenum target = LOCAL_GL_TEXTURE_RECTANGLE;
auto fb = MozFramebuffer::CreateForBacking(desc.gl, desc.size, 0, false,