Implement EGLImage external texture API for GL.

Tests are based on the IOSurfaceWrappingTests.
Sampling tests are not implemented, since they would require
support for the samplerExternalOES sampler type in WGSL.

Bug: chromium:1205155
Change-Id: Icc114eaf6efaee93f1b8486e615f0fd307f23080
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/50201
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/dawn_native/opengl/OpenGLBackend.cpp b/src/dawn_native/opengl/OpenGLBackend.cpp
index 6cc87b0..3e089bb 100644
--- a/src/dawn_native/opengl/OpenGLBackend.cpp
+++ b/src/dawn_native/opengl/OpenGLBackend.cpp
@@ -50,4 +50,15 @@
         return static_cast<WGPUTextureFormat>(impl->GetPreferredFormat());
     }
 
+    ExternalImageDescriptorEGLImage::ExternalImageDescriptorEGLImage()
+        : ExternalImageDescriptor(ExternalImageType::EGLImage) {
+    }
+
+    WGPUTexture WrapExternalEGLImage(WGPUDevice cDevice,
+                                     const ExternalImageDescriptorEGLImage* descriptor) {
+        Device* device = reinterpret_cast<Device*>(cDevice);
+        TextureBase* texture = device->CreateTextureWrappingEGLImage(descriptor, descriptor->image);
+        return reinterpret_cast<WGPUTexture>(texture);
+    }
+
 }}  // namespace dawn_native::opengl