From fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:14:29 +0200 Subject: Merging upstream version 125.0.1. Signed-off-by: Daniel Baumann --- .../RenderMacIOSurfaceTextureHost.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'gfx/webrender_bindings/RenderMacIOSurfaceTextureHost.cpp') diff --git a/gfx/webrender_bindings/RenderMacIOSurfaceTextureHost.cpp b/gfx/webrender_bindings/RenderMacIOSurfaceTextureHost.cpp index bb0575949b..c1f93327e5 100644 --- a/gfx/webrender_bindings/RenderMacIOSurfaceTextureHost.cpp +++ b/gfx/webrender_bindings/RenderMacIOSurfaceTextureHost.cpp @@ -6,16 +6,20 @@ #include "RenderMacIOSurfaceTextureHost.h" -#include "GLContextCGL.h" +#ifdef XP_MACOSX +# include "GLContextCGL.h" +#else +# include "GLContextEAGL.h" +#endif + #include "mozilla/gfx/Logging.h" #include "ScopedGLHelpers.h" namespace mozilla { namespace wr { -static CGLError CreateTextureForPlane(uint8_t aPlaneID, gl::GLContext* aGL, - MacIOSurface* aSurface, - GLuint* aTexture) { +static bool CreateTextureForPlane(uint8_t aPlaneID, gl::GLContext* aGL, + MacIOSurface* aSurface, GLuint* aTexture) { MOZ_ASSERT(aGL && aSurface && aTexture); aGL->fGenTextures(1, aTexture); @@ -26,10 +30,8 @@ static CGLError CreateTextureForPlane(uint8_t aPlaneID, gl::GLContext* aGL, aGL->fTexParameteri(LOCAL_GL_TEXTURE_RECTANGLE_ARB, LOCAL_GL_TEXTURE_WRAP_S, LOCAL_GL_CLAMP_TO_EDGE); - CGLError result = kCGLNoError; gfx::SurfaceFormat readFormat = gfx::SurfaceFormat::UNKNOWN; - result = aSurface->CGLTexImageIOSurface2D( - aGL, gl::GLContextCGL::Cast(aGL)->GetCGLContext(), aPlaneID, &readFormat); + bool result = aSurface->BindTexImage(aGL, aPlaneID, &readFormat); // If this is a yuv format, the Webrender only supports YUV422 interleaving // format. MOZ_ASSERT(aSurface->GetFormat() != gfx::SurfaceFormat::YUV422 || @@ -89,7 +91,11 @@ wr::WrExternalImage RenderMacIOSurfaceTextureHost::Lock(uint8_t aChannelIndex, } if (!mTextureHandles[0]) { +#ifdef XP_MACOSX MOZ_ASSERT(gl::GLContextCGL::Cast(mGL.get())->GetCGLContext()); +#else + MOZ_ASSERT(gl::GLContextEAGL::Cast(mGL.get())->GetEAGLContext()); +#endif // The result of GetPlaneCount() is 0 for single plane format, but it will // be 2 if the format has 2 planar data. -- cgit v1.2.3