Title: [249909] trunk/Source/WebCore
Revision
249909
Author
[email protected]
Date
2019-09-16 11:59:18 -0700 (Mon, 16 Sep 2019)

Log Message

[GTK] Remove GraphicsContext3D dependency from the outside of WebGL
https://bugs.webkit.org/show_bug.cgi?id=201748

Patch by ChangSeok Oh <[email protected]> on 2019-09-16
Reviewed by Alex Christensen.

This is a preliminary change to bring ANGLE support for WebGL to GTK port.
GraphicsContext3DANGLE has its own egl context but we want to make ANGLE egl context
for WebGL and other GL contexts (i.e., glx, gles/egl) for TextureMapper live together.
Mixed uses of GraphicsContext3D outside of WebGL code could cause unintended behaviors.
We want to make sure that only WebGL code uses it.

No new tests since no functionality changed.

* platform/graphics/GLContext.cpp:
* platform/graphics/GLContext.h:
* platform/graphics/glx/GLContextGLX.cpp:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::GstVideoFrameHolder::platformLayerBuffer):
(WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
* platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (249908 => 249909)


--- trunk/Source/WebCore/ChangeLog	2019-09-16 18:44:36 UTC (rev 249908)
+++ trunk/Source/WebCore/ChangeLog	2019-09-16 18:59:18 UTC (rev 249909)
@@ -1,3 +1,26 @@
+2019-09-16  ChangSeok Oh  <[email protected]>
+
+        [GTK] Remove GraphicsContext3D dependency from the outside of WebGL
+        https://bugs.webkit.org/show_bug.cgi?id=201748
+
+        Reviewed by Alex Christensen.
+
+        This is a preliminary change to bring ANGLE support for WebGL to GTK port.
+        GraphicsContext3DANGLE has its own egl context but we want to make ANGLE egl context
+        for WebGL and other GL contexts (i.e., glx, gles/egl) for TextureMapper live together.
+        Mixed uses of GraphicsContext3D outside of WebGL code could cause unintended behaviors.
+        We want to make sure that only WebGL code uses it.
+
+        No new tests since no functionality changed.
+
+        * platform/graphics/GLContext.cpp:
+        * platform/graphics/GLContext.h:
+        * platform/graphics/glx/GLContextGLX.cpp:
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
+        (WebCore::GstVideoFrameHolder::platformLayerBuffer):
+        (WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
+        * platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
+
 2019-09-16  Zalan Bujtas  <[email protected]>
 
         [LFC] Make the nested Geometry/MarginCollapse/Quirks c'tors private.

Modified: trunk/Source/WebCore/platform/graphics/GLContext.cpp (249908 => 249909)


--- trunk/Source/WebCore/platform/graphics/GLContext.cpp	2019-09-16 18:44:36 UTC (rev 249908)
+++ trunk/Source/WebCore/platform/graphics/GLContext.cpp	2019-09-16 18:59:18 UTC (rev 249909)
@@ -34,6 +34,7 @@
 
 #if USE(GLX)
 #include "GLContextGLX.h"
+#include "OpenGLShims.h"
 #endif
 
 using WTF::ThreadSpecific;

Modified: trunk/Source/WebCore/platform/graphics/GLContext.h (249908 => 249909)


--- trunk/Source/WebCore/platform/graphics/GLContext.h	2019-09-16 18:44:36 UTC (rev 249908)
+++ trunk/Source/WebCore/platform/graphics/GLContext.h	2019-09-16 18:59:18 UTC (rev 249909)
@@ -20,7 +20,7 @@
 #ifndef GLContext_h
 #define GLContext_h
 
-#include "GraphicsContext3D.h"
+#include "ANGLEWebKitBridge.h"
 #include "IntSize.h"
 #include "PlatformDisplay.h"
 #include <wtf/Noncopyable.h>
@@ -41,6 +41,8 @@
 typedef struct _cairo_device cairo_device_t;
 #endif
 
+typedef void* PlatformGraphicsContext3D;
+
 namespace WebCore {
 
 class IntSize;

Modified: trunk/Source/WebCore/platform/graphics/glx/GLContextGLX.cpp (249908 => 249909)


--- trunk/Source/WebCore/platform/graphics/glx/GLContextGLX.cpp	2019-09-16 18:44:36 UTC (rev 249908)
+++ trunk/Source/WebCore/platform/graphics/glx/GLContextGLX.cpp	2019-09-16 18:59:18 UTC (rev 249909)
@@ -20,7 +20,6 @@
 #include "GLContextGLX.h"
 
 #if USE(GLX)
-#include "GraphicsContext3D.h"
 #include "OpenGLShims.h"
 #include "PlatformDisplayX11.h"
 #include "XErrorTrapper.h"

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp (249908 => 249909)


--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp	2019-09-16 18:44:36 UTC (rev 249908)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp	2019-09-16 18:59:18 UTC (rev 249909)
@@ -93,7 +93,6 @@
 #if USE(TEXTURE_MAPPER_GL)
 #include "BitmapTextureGL.h"
 #include "BitmapTexturePool.h"
-#include "GraphicsContext3D.h"
 #include "TextureMapperContextAttributes.h"
 #include "TextureMapperPlatformLayerBuffer.h"
 #include "TextureMapperPlatformLayerProxy.h"
@@ -227,7 +226,7 @@
         using Buffer = TextureMapperPlatformLayerBuffer;
 
         if ((GST_VIDEO_INFO_IS_RGB(&m_videoFrame.info) && GST_VIDEO_INFO_N_PLANES(&m_videoFrame.info) == 1))
-            return makeUnique<Buffer>(Buffer::TextureVariant { Buffer::RGBTexture { *static_cast<GLuint*>(m_videoFrame.data[0]) } }, m_size, m_flags, GraphicsContext3D::RGBA);
+            return makeUnique<Buffer>(Buffer::TextureVariant { Buffer::RGBTexture { *static_cast<GLuint*>(m_videoFrame.data[0]) } }, m_size, m_flags, GL_RGBA);
 
         if (GST_VIDEO_INFO_IS_YUV(&m_videoFrame.info)) {
             if (GST_VIDEO_INFO_N_COMPONENTS(&m_videoFrame.info) < 3 || GST_VIDEO_INFO_N_PLANES(&m_videoFrame.info) > 3)
@@ -237,7 +236,7 @@
                 // IMX VPU decoder decodes YUV data only into the Y texture from which the sampler
                 // then directly produces RGBA data. Textures for other planes aren't used, but
                 // that's decoder's problem. We have to treat that Y texture as having RGBA data.
-                return makeUnique<Buffer>(Buffer::TextureVariant { Buffer::RGBTexture { *static_cast<GLuint*>(m_videoFrame.data[0]) } }, m_size, m_flags, GraphicsContext3D::RGBA);
+                return makeUnique<Buffer>(Buffer::TextureVariant { Buffer::RGBTexture { *static_cast<GLuint*>(m_videoFrame.data[0]) } }, m_size, m_flags, GL_RGBA);
             }
 
             unsigned numberOfPlanes = GST_VIDEO_INFO_N_PLANES(&m_videoFrame.info);
@@ -267,7 +266,7 @@
                 };
             }
 
-            return makeUnique<Buffer>( Buffer::TextureVariant { Buffer::YUVTexture { numberOfPlanes, planes, yuvPlane, yuvPlaneOffset, yuvToRgb } }, m_size, m_flags, GraphicsContext3D::RGBA);
+            return makeUnique<Buffer>( Buffer::TextureVariant { Buffer::YUVTexture { numberOfPlanes, planes, yuvPlane, yuvPlaneOffset, yuvToRgb } }, m_size, m_flags, GL_RGBA);
         }
 
         return nullptr;
@@ -1094,7 +1093,7 @@
 
     frameHolder->waitForCPUSync();
 
-    if (!m_videoTextureCopier->copyVideoTextureToPlatformTexture(*layerBuffer.get(), size, 0, GraphicsContext3D::TEXTURE_2D, 0, GraphicsContext3D::RGBA, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, false, m_videoSourceOrientation))
+    if (!m_videoTextureCopier->copyVideoTextureToPlatformTexture(*layerBuffer.get(), size, 0, GL_TEXTURE_2D, 0, GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, false, m_videoSourceOrientation))
         return nullptr;
 
     return adoptRef(cairo_gl_surface_create_for_texture(context->cairoDevice(), CAIRO_CONTENT_COLOR_ALPHA, m_videoTextureCopier->resultTexture(), size.width(), size.height()));

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp (249908 => 249909)


--- trunk/Source/WebCore/platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp	2019-09-16 18:44:36 UTC (rev 249908)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp	2019-09-16 18:59:18 UTC (rev 249909)
@@ -23,6 +23,7 @@
 
 #if USE(GSTREAMER_GL)
 
+#include "FloatRect.h"
 #include "GLContext.h"
 #include "ImageOrientation.h"
 #include "TextureMapperShaderProgram.h"
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to