summaryrefslogtreecommitdiffstats
path: root/gfx/webrender_bindings/RenderMacIOSurfaceTextureHost.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/webrender_bindings/RenderMacIOSurfaceTextureHost.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/webrender_bindings/RenderMacIOSurfaceTextureHost.cpp')
-rw-r--r--gfx/webrender_bindings/RenderMacIOSurfaceTextureHost.cpp20
1 files changed, 13 insertions, 7 deletions
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.