summaryrefslogtreecommitdiffstats
path: root/gfx/webrender_bindings/RenderMacIOSurfaceTextureHost.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
commitfbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch)
tree4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /gfx/webrender_bindings/RenderMacIOSurfaceTextureHost.cpp
parentReleasing progress-linux version 124.0.1-1~progress7.99u1. (diff)
downloadfirefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz
firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.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.