Title: [228590] trunk
Revision
228590
Author
[email protected]
Date
2018-02-16 16:48:36 -0800 (Fri, 16 Feb 2018)

Log Message

Use OPENGL macros to be more clear about which OpenGL/ES WebGL uses on Cocoa
https://bugs.webkit.org/show_bug.cgi?id=182894

Reviewed by Tim Horton.

.:

Rename OPENGL_ES_2 to OPENGL_ES.

* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsWPE.cmake:

PerformanceTests:

Rename OPENGL_ES_2 to OPENGL_ES.

* StitchMarker/wtf/Platform.h:

Source/WebCore:

Adjust the places where we check for PLATFORM(MAC) or
PLATFORM(IOS) related to WebGL, and instead rely
on USE(OPENGL) USE(OPENGL_ES).

* CMakeLists.txt:
* PlatformGTK.cmake:
* platform/graphics/GLContext.cpp:
(WebCore::initializeOpenGLShimsIfNeeded):
* platform/graphics/GraphicsContext3DPrivate.cpp:
* platform/graphics/OpenGLESShims.h:
* platform/graphics/cairo/ImageBufferCairo.cpp:
* platform/graphics/egl/GLContextEGL.cpp:
(WebCore::GLContextEGL::getEGLConfig):
(WebCore::GLContextEGL::createContext):
(WebCore::GLContextEGL::createSharingContext):
* platform/graphics/egl/GLContextEGLWPE.cpp:
(WebCore::GLContextEGL::createWPEContext):
* platform/graphics/egl/GLContextEGLWayland.cpp:
(WebCore::GLContextEGL::createWaylandContext):
* platform/graphics/egl/GLContextEGLX11.cpp:
(WebCore::GLContextEGL::createPixmapContext):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
* platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
(WebCore::VideoTextureCopierGStreamer::VideoTextureCopierGStreamer):
(WebCore::VideoTextureCopierGStreamer::~VideoTextureCopierGStreamer):
(WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
* platform/graphics/gstreamer/VideoTextureCopierGStreamer.h:
* platform/graphics/opengl/Extensions3DOpenGLES.cpp:
* platform/graphics/opengl/Extensions3DOpenGLES.h:
* platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
(WebCore::GraphicsContext3D::create):
(WebCore::GraphicsContext3D::GraphicsContext3D):
(WebCore::GraphicsContext3D::isGLES2Compliant const):
* platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp:
(WebCore::GraphicsContext3D::create):
(WebCore::GraphicsContext3D::GraphicsContext3D):
(WebCore::GraphicsContext3D::~GraphicsContext3D):
(WebCore::GraphicsContext3D::isGLES2Compliant const):
(WebCore::GraphicsContext3D::getExtensions):
* platform/graphics/texmap/TextureMapperContextAttributes.cpp:
(WebCore::TextureMapperContextAttributes::initialize):
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGLData::~TextureMapperGLData):
(WebCore::TextureMapperGLData::getVAO):
(WebCore::TextureMapperGL::beginPainting):
(WebCore::TextureMapperGL::endPainting):
* platform/graphics/texmap/TextureMapperGLHeaders.h:
* platform/graphics/texmap/TextureMapperShaderProgram.cpp:
(WebCore::TextureMapperShaderProgram::create):

Source/WebKit:

Rename OPENGL_ES_2 to OPENGL_ES.

* CMakeLists.txt:
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
* UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
(WebKit::AcceleratedBackingStoreWayland::paint):
* UIProcess/gtk/WaylandCompositor.cpp:
(WebKit::WaylandCompositor::initializeEGL):

Source/WebKitLegacy/win:

Rename OPENGL_ES_2 to OPENGL_ES.

* WebCoreSupport/AcceleratedCompositingContext.cpp:

Source/WTF:

If we're on a Cocoa platform, define USE_OPENGL/USE_OPENGL_ES
depending on what we're actually going to use. In this case,
they are exclusive, but it doesn't appear that other platforms
use this approach. Ultimately the idea is to be more concerned
with the type of OpenGL we're using, rather than the platform.

* wtf/Platform.h: Define USE_OPENGL(_ES) for PLATFORM(COCOA).

Modified Paths

Diff

Modified: trunk/ChangeLog (228589 => 228590)


--- trunk/ChangeLog	2018-02-17 00:46:52 UTC (rev 228589)
+++ trunk/ChangeLog	2018-02-17 00:48:36 UTC (rev 228590)
@@ -1,3 +1,15 @@
+2018-02-16  Dean Jackson  <[email protected]>
+
+        Use OPENGL macros to be more clear about which OpenGL/ES WebGL uses on Cocoa
+        https://bugs.webkit.org/show_bug.cgi?id=182894
+
+        Reviewed by Tim Horton.
+
+        Rename OPENGL_ES_2 to OPENGL_ES.
+
+        * Source/cmake/OptionsGTK.cmake:
+        * Source/cmake/OptionsWPE.cmake:
+
 2018-02-09  Ross Kirsling  <[email protected]>
 
         Simplify .gitignore's WebKitLibraries/win section.

Modified: trunk/PerformanceTests/ChangeLog (228589 => 228590)


--- trunk/PerformanceTests/ChangeLog	2018-02-17 00:46:52 UTC (rev 228589)
+++ trunk/PerformanceTests/ChangeLog	2018-02-17 00:48:36 UTC (rev 228590)
@@ -1,3 +1,14 @@
+2018-02-16  Dean Jackson  <[email protected]>
+
+        Use OPENGL macros to be more clear about which OpenGL/ES WebGL uses on Cocoa
+        https://bugs.webkit.org/show_bug.cgi?id=182894
+
+        Reviewed by Tim Horton.
+
+        Rename OPENGL_ES_2 to OPENGL_ES.
+
+        * StitchMarker/wtf/Platform.h:
+
 2018-02-09  Ryosuke Niwa  <[email protected]>
 
         Make run-perf-tests work with Speedometer 2.0 and re-enable the test

Modified: trunk/PerformanceTests/StitchMarker/wtf/Platform.h (228589 => 228590)


--- trunk/PerformanceTests/StitchMarker/wtf/Platform.h	2018-02-17 00:46:52 UTC (rev 228589)
+++ trunk/PerformanceTests/StitchMarker/wtf/Platform.h	2018-02-17 00:48:36 UTC (rev 228590)
@@ -979,7 +979,7 @@
 
 #if ENABLE(WEBGL) && PLATFORM(WIN)
 #define USE_OPENGL 1
-#define USE_OPENGL_ES_2 1
+#define USE_OPENGL_ES 1
 #define USE_EGL 1
 #endif
 

Modified: trunk/Source/WTF/ChangeLog (228589 => 228590)


--- trunk/Source/WTF/ChangeLog	2018-02-17 00:46:52 UTC (rev 228589)
+++ trunk/Source/WTF/ChangeLog	2018-02-17 00:48:36 UTC (rev 228590)
@@ -1,3 +1,18 @@
+2018-02-16  Dean Jackson  <[email protected]>
+
+        Use OPENGL macros to be more clear about which OpenGL/ES WebGL uses on Cocoa
+        https://bugs.webkit.org/show_bug.cgi?id=182894
+
+        Reviewed by Tim Horton.
+
+        If we're on a Cocoa platform, define USE_OPENGL/USE_OPENGL_ES
+        depending on what we're actually going to use. In this case,
+        they are exclusive, but it doesn't appear that other platforms
+        use this approach. Ultimately the idea is to be more concerned
+        with the type of OpenGL we're using, rather than the platform.
+
+        * wtf/Platform.h: Define USE_OPENGL(_ES) for PLATFORM(COCOA).
+
 2018-02-16  Filip Pizlo  <[email protected]>
 
         Unreviewed, roll out r228306 (custom memcpy/memset) because the bots say that it was not a

Modified: trunk/Source/WTF/wtf/Platform.h (228589 => 228590)


--- trunk/Source/WTF/wtf/Platform.h	2018-02-17 00:46:52 UTC (rev 228589)
+++ trunk/Source/WTF/wtf/Platform.h	2018-02-17 00:48:36 UTC (rev 228590)
@@ -1035,9 +1035,19 @@
 #endif
 #endif
 
+#if ENABLE(WEBGL) && PLATFORM(COCOA)
+#if PLATFORM(MAC)
+#define USE_OPENGL 1
+#define USE_OPENGL_ES 0
+#else
+#define USE_OPENGL 0
+#define USE_OPENGL_ES 1
+#endif
+#endif
+
 #if ENABLE(WEBGL) && PLATFORM(WIN)
 #define USE_OPENGL 1
-#define USE_OPENGL_ES_2 1
+#define USE_OPENGL_ES 1
 #define USE_EGL 1
 #endif
 

Modified: trunk/Source/WebCore/CMakeLists.txt (228589 => 228590)


--- trunk/Source/WebCore/CMakeLists.txt	2018-02-17 00:46:52 UTC (rev 228589)
+++ trunk/Source/WebCore/CMakeLists.txt	2018-02-17 00:48:36 UTC (rev 228590)
@@ -1341,7 +1341,7 @@
                 ${OPENGL_LIBRARIES}
             )
             add_definitions(${OPENGL_DEFINITIONS})
-        elseif (USE_OPENGL_ES_2)
+        elseif (USE_OPENGL_ES)
             list(APPEND WebCore_SYSTEM_INCLUDE_DIRECTORIES
                 ${OPENGLES2_INCLUDE_DIRS}
             )

Modified: trunk/Source/WebCore/ChangeLog (228589 => 228590)


--- trunk/Source/WebCore/ChangeLog	2018-02-17 00:46:52 UTC (rev 228589)
+++ trunk/Source/WebCore/ChangeLog	2018-02-17 00:48:36 UTC (rev 228590)
@@ -1,3 +1,61 @@
+2018-02-16  Dean Jackson  <[email protected]>
+
+        Use OPENGL macros to be more clear about which OpenGL/ES WebGL uses on Cocoa
+        https://bugs.webkit.org/show_bug.cgi?id=182894
+
+        Reviewed by Tim Horton.
+
+        Adjust the places where we check for PLATFORM(MAC) or
+        PLATFORM(IOS) related to WebGL, and instead rely
+        on USE(OPENGL) USE(OPENGL_ES).
+
+        * CMakeLists.txt:
+        * PlatformGTK.cmake:
+        * platform/graphics/GLContext.cpp:
+        (WebCore::initializeOpenGLShimsIfNeeded):
+        * platform/graphics/GraphicsContext3DPrivate.cpp:
+        * platform/graphics/OpenGLESShims.h:
+        * platform/graphics/cairo/ImageBufferCairo.cpp:
+        * platform/graphics/egl/GLContextEGL.cpp:
+        (WebCore::GLContextEGL::getEGLConfig):
+        (WebCore::GLContextEGL::createContext):
+        (WebCore::GLContextEGL::createSharingContext):
+        * platform/graphics/egl/GLContextEGLWPE.cpp:
+        (WebCore::GLContextEGL::createWPEContext):
+        * platform/graphics/egl/GLContextEGLWayland.cpp:
+        (WebCore::GLContextEGL::createWaylandContext):
+        * platform/graphics/egl/GLContextEGLX11.cpp:
+        (WebCore::GLContextEGL::createPixmapContext):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
+        (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
+        * platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
+        (WebCore::VideoTextureCopierGStreamer::VideoTextureCopierGStreamer):
+        (WebCore::VideoTextureCopierGStreamer::~VideoTextureCopierGStreamer):
+        (WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
+        * platform/graphics/gstreamer/VideoTextureCopierGStreamer.h:
+        * platform/graphics/opengl/Extensions3DOpenGLES.cpp:
+        * platform/graphics/opengl/Extensions3DOpenGLES.h:
+        * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
+        (WebCore::GraphicsContext3D::create):
+        (WebCore::GraphicsContext3D::GraphicsContext3D):
+        (WebCore::GraphicsContext3D::isGLES2Compliant const):
+        * platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp:
+        (WebCore::GraphicsContext3D::create):
+        (WebCore::GraphicsContext3D::GraphicsContext3D):
+        (WebCore::GraphicsContext3D::~GraphicsContext3D):
+        (WebCore::GraphicsContext3D::isGLES2Compliant const):
+        (WebCore::GraphicsContext3D::getExtensions):
+        * platform/graphics/texmap/TextureMapperContextAttributes.cpp:
+        (WebCore::TextureMapperContextAttributes::initialize):
+        * platform/graphics/texmap/TextureMapperGL.cpp:
+        (WebCore::TextureMapperGLData::~TextureMapperGLData):
+        (WebCore::TextureMapperGLData::getVAO):
+        (WebCore::TextureMapperGL::beginPainting):
+        (WebCore::TextureMapperGL::endPainting):
+        * platform/graphics/texmap/TextureMapperGLHeaders.h:
+        * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
+        (WebCore::TextureMapperShaderProgram::create):
+
 2018-02-16  Zalan Bujtas  <[email protected]>
 
         [RenderTreeBuilder] Move RenderElement::insertChildInternal() to RenderTreeBuilder

Modified: trunk/Source/WebCore/PlatformGTK.cmake (228589 => 228590)


--- trunk/Source/WebCore/PlatformGTK.cmake	2018-02-17 00:46:52 UTC (rev 228589)
+++ trunk/Source/WebCore/PlatformGTK.cmake	2018-02-17 00:48:36 UTC (rev 228590)
@@ -128,7 +128,7 @@
     ${ZLIB_INCLUDE_DIRS}
 )
 
-if (USE_OPENGL_ES_2)
+if (USE_OPENGL_ES)
     list(APPEND WebCore_SOURCES
         platform/graphics/opengl/Extensions3DOpenGLES.cpp
         platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp

Modified: trunk/Source/WebCore/platform/graphics/ANGLEWebKitBridge.h (228589 => 228590)


--- trunk/Source/WebCore/platform/graphics/ANGLEWebKitBridge.h	2018-02-17 00:46:52 UTC (rev 228589)
+++ trunk/Source/WebCore/platform/graphics/ANGLEWebKitBridge.h	2018-02-17 00:48:36 UTC (rev 228590)
@@ -35,16 +35,23 @@
 #include <ANGLE/ShaderLang.h>
 #include <wtf/text/WTFString.h>
 
-#if PLATFORM(IOS)
+#if PLATFORM(COCOA)
+
+#if USE(OPENGL_ES)
 #import <OpenGLES/ES2/glext.h>
-#elif PLATFORM(MAC)
+#else
 #include <OpenGL/gl.h>
+#endif
+
 #elif PLATFORM(WIN)
 #include "OpenGLESShims.h"
+
 #elif USE(LIBEPOXY)
 // <epoxy/gl.h> already included above.
-#elif USE(OPENGL_ES_2)
+
+#elif USE(OPENGL_ES)
 #include <GLES2/gl2.h>
+
 #else
 #include "OpenGLShims.h"
 #endif

Modified: trunk/Source/WebCore/platform/graphics/GLContext.cpp (228589 => 228590)


--- trunk/Source/WebCore/platform/graphics/GLContext.cpp	2018-02-17 00:46:52 UTC (rev 228589)
+++ trunk/Source/WebCore/platform/graphics/GLContext.cpp	2018-02-17 00:48:36 UTC (rev 228590)
@@ -28,7 +28,7 @@
 
 #if USE(LIBEPOXY)
 #include <epoxy/gl.h>
-#elif USE(OPENGL_ES_2)
+#elif USE(OPENGL_ES)
 #define GL_GLEXT_PROTOTYPES 1
 #include <GLES2/gl2.h>
 #include <GLES3/gl3.h>
@@ -64,7 +64,7 @@
 
 static bool initializeOpenGLShimsIfNeeded()
 {
-#if USE(OPENGL_ES_2) || USE(LIBEPOXY)
+#if USE(OPENGL_ES) || USE(LIBEPOXY)
     return true;
 #else
     static bool initialized = false;

Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h (228589 => 228590)


--- trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h	2018-02-17 00:46:52 UTC (rev 228589)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h	2018-02-17 00:48:36 UTC (rev 228590)
@@ -86,7 +86,7 @@
 
 namespace WebCore {
 class Extensions3D;
-#if USE(OPENGL_ES_2)
+#if !PLATFORM(COCOA) && USE(OPENGL_ES)
 class Extensions3DOpenGLES;
 #else
 class Extensions3DOpenGL;
@@ -1394,7 +1394,7 @@
 
     std::unique_ptr<ShaderNameHash> nameHashMapForShaders;
 
-#if USE(OPENGL_ES_2)
+#if !PLATFORM(COCOA) && USE(OPENGL_ES)
     friend class Extensions3DOpenGLES;
     std::unique_ptr<Extensions3DOpenGLES> m_extensions;
 #else

Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext3DPrivate.cpp (228589 => 228590)


--- trunk/Source/WebCore/platform/graphics/GraphicsContext3DPrivate.cpp	2018-02-17 00:46:52 UTC (rev 228589)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext3DPrivate.cpp	2018-02-17 00:48:36 UTC (rev 228590)
@@ -28,7 +28,7 @@
 
 #if USE(LIBEPOXY)
 #include <epoxy/gl.h>
-#elif USE(OPENGL_ES_2)
+#elif USE(OPENGL_ES)
 #include <GLES2/gl2.h>
 #include <GLES2/gl2ext.h>
 #else

Modified: trunk/Source/WebCore/platform/graphics/OpenGLESShims.h (228589 => 228590)


--- trunk/Source/WebCore/platform/graphics/OpenGLESShims.h	2018-02-17 00:46:52 UTC (rev 228589)
+++ trunk/Source/WebCore/platform/graphics/OpenGLESShims.h	2018-02-17 00:48:36 UTC (rev 228590)
@@ -26,7 +26,7 @@
 #ifndef OpenGLESShims_h
 #define OpenGLESShims_h
 
-#if USE(OPENGL_ES_2)
+#if USE(OPENGL_ES)
 #define glBindFramebufferEXT glBindFramebuffer
 #define glFramebufferTexture2DEXT glFramebufferTexture2D
 #define glBindRenderbufferEXT glBindRenderbuffer

Modified: trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp (228589 => 228590)


--- trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp	2018-02-17 00:46:52 UTC (rev 228589)
+++ trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp	2018-02-17 00:48:36 UTC (rev 228590)
@@ -57,7 +57,7 @@
 #endif
 #include <cairo-gl.h>
 
-#if USE(OPENGL_ES_2)
+#if USE(OPENGL_ES)
 #include <GLES2/gl2.h>
 #else
 #include "OpenGLShims.h"

Modified: trunk/Source/WebCore/platform/graphics/egl/GLContextEGL.cpp (228589 => 228590)


--- trunk/Source/WebCore/platform/graphics/egl/GLContextEGL.cpp	2018-02-17 00:46:52 UTC (rev 228589)
+++ trunk/Source/WebCore/platform/graphics/egl/GLContextEGL.cpp	2018-02-17 00:48:36 UTC (rev 228590)
@@ -36,7 +36,7 @@
 
 #if USE(LIBEPOXY)
 #include <epoxy/gl.h>
-#elif USE(OPENGL_ES_2)
+#elif USE(OPENGL_ES)
 #define GL_GLEXT_PROTOTYPES 1
 #include <GLES2/gl2.h>
 #include <GLES2/gl2ext.h>
@@ -55,13 +55,13 @@
 namespace WebCore {
 
 static const EGLint gContextAttributes[] = {
-#if USE(OPENGL_ES_2)
+#if USE(OPENGL_ES)
     EGL_CONTEXT_CLIENT_VERSION, 2,
 #endif
     EGL_NONE
 };
 
-#if USE(OPENGL_ES_2)
+#if USE(OPENGL_ES)
 static const EGLenum gEGLAPIVersion = EGL_OPENGL_ES_API;
 #else
 static const EGLenum gEGLAPIVersion = EGL_OPENGL_API;
@@ -101,7 +101,7 @@
 bool GLContextEGL::getEGLConfig(EGLDisplay display, EGLConfig* config, EGLSurfaceType surfaceType)
 {
     EGLint attributeList[] = {
-#if USE(OPENGL_ES_2)
+#if USE(OPENGL_ES)
         EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
 #else
         EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT,
@@ -235,7 +235,7 @@
     }
 
     if (eglBindAPI(gEGLAPIVersion) == EGL_FALSE) {
-#if USE(OPENGL_ES_2)
+#if USE(OPENGL_ES)
         WTFLogAlways("Cannot create EGL context: error binding OpenGL ES API (%s)\n", lastErrorString());
 #else
         WTFLogAlways("Cannot create EGL context: error binding OpenGL API (%s)\n", lastErrorString());
@@ -275,7 +275,7 @@
     }
 
     if (eglBindAPI(gEGLAPIVersion) == EGL_FALSE) {
-#if USE(OPENGL_ES_2)
+#if USE(OPENGL_ES)
         WTFLogAlways("Cannot create EGL sharing context: error binding OpenGL ES API (%s)\n", lastErrorString());
 #else
         WTFLogAlways("Cannot create EGL sharing context: error binding OpenGL API (%s)\n", lastErrorString());

Modified: trunk/Source/WebCore/platform/graphics/egl/GLContextEGLWPE.cpp (228589 => 228590)


--- trunk/Source/WebCore/platform/graphics/egl/GLContextEGLWPE.cpp	2018-02-17 00:46:52 UTC (rev 228589)
+++ trunk/Source/WebCore/platform/graphics/egl/GLContextEGLWPE.cpp	2018-02-17 00:48:36 UTC (rev 228590)
@@ -54,7 +54,7 @@
     }
 
     static const EGLint contextAttributes[] = {
-#if USE(OPENGL_ES_2)
+#if USE(OPENGL_ES)
         EGL_CONTEXT_CLIENT_VERSION, 2,
 #endif
         EGL_NONE

Modified: trunk/Source/WebCore/platform/graphics/egl/GLContextEGLWayland.cpp (228589 => 228590)


--- trunk/Source/WebCore/platform/graphics/egl/GLContextEGLWayland.cpp	2018-02-17 00:46:52 UTC (rev 228589)
+++ trunk/Source/WebCore/platform/graphics/egl/GLContextEGLWayland.cpp	2018-02-17 00:48:36 UTC (rev 228590)
@@ -52,7 +52,7 @@
         return nullptr;
 
     static const EGLint contextAttributes[] = {
-#if USE(OPENGL_ES_2)
+#if USE(OPENGL_ES)
         EGL_CONTEXT_CLIENT_VERSION, 2,
 #endif
         EGL_NONE

Modified: trunk/Source/WebCore/platform/graphics/egl/GLContextEGLX11.cpp (228589 => 228590)


--- trunk/Source/WebCore/platform/graphics/egl/GLContextEGLX11.cpp	2018-02-17 00:46:52 UTC (rev 228589)
+++ trunk/Source/WebCore/platform/graphics/egl/GLContextEGLX11.cpp	2018-02-17 00:48:36 UTC (rev 228590)
@@ -50,7 +50,7 @@
         return nullptr;
 
     static const EGLint contextAttributes[] = {
-#if USE(OPENGL_ES_2)
+#if USE(OPENGL_ES)
         EGL_CONTEXT_CLIENT_VERSION, 2,
 #endif
         EGL_NONE

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


--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp	2018-02-17 00:46:52 UTC (rev 228589)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp	2018-02-17 00:48:36 UTC (rev 228590)
@@ -466,7 +466,7 @@
     // EGL and GLX are mutually exclusive, no need for ifdefs here.
     GstGLPlatform glPlatform = webkitContext->isEGLContext() ? GST_GL_PLATFORM_EGL : GST_GL_PLATFORM_GLX;
 
-#if USE(OPENGL_ES_2)
+#if USE(OPENGL_ES)
     GstGLAPI glAPI = GST_GL_API_GLES2;
 #elif USE(OPENGL)
     GstGLAPI glAPI = GST_GL_API_OPENGL;

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


--- trunk/Source/WebCore/platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp	2018-02-17 00:46:52 UTC (rev 228589)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp	2018-02-17 00:48:36 UTC (rev 228590)
@@ -40,7 +40,7 @@
     glGenFramebuffers(1, &m_framebuffer);
     glGenTextures(1, &m_resultTexture);
 
-#if !USE(OPENGL_ES_2)
+#if !USE(OPENGL_ES)
     // For OpenGL > 3.2 we need to have a VAO.
     if (GLContext::current()->version() >= 320)
         glGenVertexArrays(1, &m_vao);
@@ -65,7 +65,7 @@
     glDeleteFramebuffers(1, &m_framebuffer);
     glDeleteBuffers(1, &m_vbo);
     glDeleteTextures(1, &m_resultTexture);
-#if !USE(OPENGL_ES_2)
+#if !USE(OPENGL_ES)
     if (m_vao)
         glDeleteVertexArrays(1, &m_vao);
 #endif
@@ -196,7 +196,7 @@
     m_shaderProgram->setMatrix(m_shaderProgram->textureColorSpaceMatrixLocation(), m_colorConversionMatrix);
 
     // Perform the copy.
-#if !USE(OPENGL_ES_2)
+#if !USE(OPENGL_ES)
     if (GLContext::current()->version() >= 320 && m_vao)
         glBindVertexArray(m_vao);
 #endif

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/VideoTextureCopierGStreamer.h (228589 => 228590)


--- trunk/Source/WebCore/platform/graphics/gstreamer/VideoTextureCopierGStreamer.h	2018-02-17 00:46:52 UTC (rev 228589)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/VideoTextureCopierGStreamer.h	2018-02-17 00:48:36 UTC (rev 228590)
@@ -52,7 +52,7 @@
     RefPtr<TextureMapperShaderProgram> m_shaderProgram;
     GLuint m_framebuffer { 0 };
     GLuint m_vbo { 0 };
-#if !USE(OPENGL_ES_2)
+#if !USE(OPENGL_ES)
     GLuint m_vao { 0 };
 #endif
     bool m_flipY { false };

Modified: trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp (228589 => 228590)


--- trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp	2018-02-17 00:46:52 UTC (rev 228589)
+++ trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp	2018-02-17 00:48:36 UTC (rev 228590)
@@ -32,25 +32,31 @@
 #include "ANGLEWebKitBridge.h"
 #include "GraphicsContext3D.h"
 
-#if PLATFORM(IOS)
+#if PLATFORM(COCOA)
+
+#if USE(OPENGL_ES)
 #include <OpenGLES/ES2/glext.h>
 #include <OpenGLES/ES3/gl.h>
 #else
+#define GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED
+#include <OpenGL/gl.h>
+#include <OpenGL/gl3.h>
+#undef GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED
+#endif
+
+#else
+
 #if USE(LIBEPOXY)
 #include "EpoxyShims.h"
-#elif USE(OPENGL_ES_2)
+#elif USE(OPENGL_ES)
 #include "OpenGLESShims.h"
 #define GL_GLEXT_PROTOTYPES 1
 #include <GLES2/gl2.h>
 #include <GLES2/gl2ext.h>
-#elif PLATFORM(MAC)
-#define GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED
-#include <OpenGL/gl.h>
-#include <OpenGL/gl3.h>
-#undef GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED
 #elif PLATFORM(GTK) || PLATFORM(WIN)
 #include "OpenGLShims.h"
 #endif
+
 #endif
 
 #include <wtf/MainThread.h>
@@ -210,7 +216,7 @@
 
 void Extensions3DOpenGLCommon::initializeAvailableExtensions()
 {
-#if PLATFORM(MAC) || (PLATFORM(GTK) && !USE(OPENGL_ES_2))
+#if (PLATFORM(COCOA) && USE(OPENGL)) || (PLATFORM(GTK) && !USE(OPENGL_ES))
     if (m_useIndexedGetString) {
         GLint numExtensions = 0;
         ::glGetIntegerv(GL_NUM_EXTENSIONS, &numExtensions);

Modified: trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp (228589 => 228590)


--- trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp	2018-02-17 00:46:52 UTC (rev 228589)
+++ trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp	2018-02-17 00:48:36 UTC (rev 228590)
@@ -27,7 +27,7 @@
 
 #include "config.h"
 
-#if USE(OPENGL_ES_2)
+#if USE(OPENGL_ES)
 #include "Extensions3DOpenGLES.h"
 
 #if ENABLE(GRAPHICS_CONTEXT_3D)
@@ -308,4 +308,4 @@
 
 #endif // ENABLE(GRAPHICS_CONTEXT_3D)
 
-#endif // USE(OPENGL_ES_2)
+#endif // USE(OPENGL_ES)

Modified: trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.h (228589 => 228590)


--- trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.h	2018-02-17 00:46:52 UTC (rev 228589)
+++ trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.h	2018-02-17 00:48:36 UTC (rev 228590)
@@ -28,7 +28,7 @@
 
 #include "Extensions3DOpenGLCommon.h"
 
-#if USE(OPENGL_ES_2)
+#if USE(OPENGL_ES)
 
 #if USE(LIBEPOXY)
 #include <epoxy/gl.h>
@@ -129,4 +129,4 @@
 
 } // namespace WebCore
 
-#endif // USE(OPENGL_ES_2)
+#endif // USE(OPENGL_ES)

Modified: trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp (228589 => 228590)


--- trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp	2018-02-17 00:46:52 UTC (rev 228589)
+++ trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp	2018-02-17 00:48:36 UTC (rev 228590)
@@ -35,7 +35,7 @@
 #include "GraphicsContext3DIOS.h"
 #endif
 
-#if USE(OPENGL_ES_2)
+#if !PLATFORM(COCOA) && USE(OPENGL_ES)
 #include "Extensions3DOpenGLES.h"
 #else
 #include "Extensions3DOpenGL.h"
@@ -57,7 +57,9 @@
 #include <wtf/text/CString.h>
 #include <wtf/text/StringBuilder.h>
 
-#if PLATFORM(IOS)
+#if PLATFORM(COCOA)
+
+#if USE(OPENGL_ES)
 #import <OpenGLES/ES2/glext.h>
 #import <OpenGLES/ES3/gl.h>
 // From <OpenGLES/glext.h>
@@ -64,19 +66,23 @@
 #define GL_RGBA32F_ARB                      0x8814
 #define GL_RGB32F_ARB                       0x8815
 #else
-#if USE(LIBEPOXY)
-#include "EpoxyShims.h"
-#elif USE(OPENGL_ES_2)
-#include "OpenGLESShims.h"
-#elif PLATFORM(MAC)
 #define GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED
 #include <OpenGL/gl.h>
 #include <OpenGL/gl3.h>
 #include <OpenGL/gl3ext.h>
 #undef GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED
+#endif
+
+#else
+
+#if USE(LIBEPOXY)
+#include "EpoxyShims.h"
+#elif USE(OPENGL_ES)
+#include "OpenGLESShims.h"
 #elif PLATFORM(GTK) || PLATFORM(WIN)
 #include "OpenGLShims.h"
 #endif
+
 #endif
 
 
@@ -392,7 +398,7 @@
         variables.push_back(varyingSymbol);
 
     GC3Dint maxVaryingVectors = 0;
-#if !PLATFORM(IOS) && !USE(OPENGL_ES_2)
+#if !USE(OPENGL_ES)
     GC3Dint maxVaryingFloats = 0;
     ::glGetIntegerv(GL_MAX_VARYING_FLOATS, &maxVaryingFloats);
     maxVaryingVectors = maxVaryingFloats / 4;
@@ -1514,7 +1520,7 @@
 {
     makeContextCurrent();
     GLuint array = 0;
-#if !USE(OPENGL_ES_2) && (PLATFORM(GTK) || PLATFORM(WIN) || PLATFORM(IOS))
+#if !USE(OPENGL_ES) && (PLATFORM(GTK) || PLATFORM(WIN))
     glGenVertexArrays(1, &array);
 #elif defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object
     glGenVertexArraysAPPLE(1, &array);
@@ -1528,7 +1534,7 @@
         return;
     
     makeContextCurrent();
-#if !USE(OPENGL_ES_2) && (PLATFORM(GTK) || PLATFORM(WIN) || PLATFORM(IOS))
+#if !USE(OPENGL_ES) && (PLATFORM(GTK) || PLATFORM(WIN))
     glDeleteVertexArrays(1, &array);
 #elif defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object
     glDeleteVertexArraysAPPLE(1, &array);
@@ -1541,7 +1547,7 @@
         return GL_FALSE;
     
     makeContextCurrent();
-#if !USE(OPENGL_ES_2) && (PLATFORM(GTK) || PLATFORM(WIN) || PLATFORM(IOS))
+#if !USE(OPENGL_ES) && (PLATFORM(GTK) || PLATFORM(WIN))
     return glIsVertexArray(array);
 #elif defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object
     return glIsVertexArrayAPPLE(array);
@@ -1552,7 +1558,7 @@
 void GraphicsContext3D::bindVertexArray(Platform3DObject array)
 {
     makeContextCurrent();
-#if !USE(OPENGL_ES_2) && (PLATFORM(GTK) || PLATFORM(WIN) || PLATFORM(IOS))
+#if !USE(OPENGL_ES) && (PLATFORM(GTK) || PLATFORM(WIN))
     glBindVertexArray(array);
 #elif defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object
     glBindVertexArrayAPPLE(array);
@@ -1845,7 +1851,7 @@
 {
     makeContextCurrent();
 
-#if !PLATFORM(IOS) && !USE(OPENGL_ES_2)
+#if !USE(OPENGL_ES)
     if (type == HALF_FLOAT_OES)
         type = GL_HALF_FLOAT_ARB;
 #endif

Modified: trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp (228589 => 228590)


--- trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp	2018-02-17 00:46:52 UTC (rev 228589)
+++ trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp	2018-02-17 00:48:36 UTC (rev 228590)
@@ -263,7 +263,7 @@
     static bool initialized = false;
     static bool success = true;
     if (!initialized) {
-#if !USE(OPENGL_ES_2)
+#if !USE(OPENGL_ES)
         success = initializeOpenGLShims();
 #endif
         initialized = true;
@@ -334,7 +334,7 @@
     
     m_compiler.setResources(ANGLEResources);
     
-#if !USE(OPENGL_ES_2)
+#if !USE(OPENGL_ES)
     ::glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
     ::glEnable(GL_POINT_SPRITE);
 #endif
@@ -389,7 +389,7 @@
 
 bool GraphicsContext3D::isGLES2Compliant() const
 {
-#if USE(OPENGL_ES_2)
+#if USE(OPENGL_ES)
     return true;
 #else
     return false;

Modified: trunk/Source/WebCore/platform/graphics/opengl/TemporaryOpenGLSetting.cpp (228589 => 228590)


--- trunk/Source/WebCore/platform/graphics/opengl/TemporaryOpenGLSetting.cpp	2018-02-17 00:46:52 UTC (rev 228589)
+++ trunk/Source/WebCore/platform/graphics/opengl/TemporaryOpenGLSetting.cpp	2018-02-17 00:48:36 UTC (rev 228590)
@@ -31,14 +31,20 @@
 
 #if USE(LIBEPOXY)
 #include "EpoxyShims.h"
-#elif USE(OPENGL_ES_2)
+
+#elif PLATFORM(COCOA)
+
+#if USE(OPENGL_ES)
+#include <OpenGLES/ES2/gl.h>
+#else
+#include <OpenGL/gl.h>
+#endif
+
+#elif USE(OPENGL_ES)
 #define GL_GLEXT_PROTOTYPES 1
 #include <GLES2/gl2.h>
 #include "OpenGLESShims.h"
-#elif PLATFORM(IOS)
-#include <OpenGLES/ES2/gl.h>
-#elif PLATFORM(MAC)
-#include <OpenGL/gl.h>
+
 #elif PLATFORM(GTK) || PLATFORM(WIN)
 #include "OpenGLShims.h"
 #endif

Modified: trunk/Source/WebCore/platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp (228589 => 228590)


--- trunk/Source/WebCore/platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp	2018-02-17 00:46:52 UTC (rev 228589)
+++ trunk/Source/WebCore/platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp	2018-02-17 00:48:36 UTC (rev 228590)
@@ -43,11 +43,11 @@
 
 #if USE(LIBEPOXY)
 #include <epoxy/gl.h>
-#elif !USE(OPENGL_ES_2)
+#elif !USE(OPENGL_ES)
 #include "OpenGLShims.h"
 #endif
 
-#if USE(OPENGL_ES_2)
+#if USE(OPENGL_ES)
 #include "Extensions3DOpenGLES.h"
 #else
 #include "Extensions3DOpenGL.h"
@@ -71,7 +71,7 @@
     static bool initialized = false;
     static bool success = true;
     if (!initialized) {
-#if !USE(OPENGL_ES_2) && !USE(LIBEPOXY)
+#if !USE(OPENGL_ES) && !USE(LIBEPOXY)
         success = initializeOpenGLShims();
 #endif
         initialized = true;
@@ -91,7 +91,7 @@
     // Create the GraphicsContext3D object first in order to establist a current context on this thread.
     auto context = adoptRef(new GraphicsContext3D(attributes, hostWindow, renderStyle));
 
-#if USE(LIBEPOXY) && USE(OPENGL_ES_2)
+#if USE(LIBEPOXY) && USE(OPENGL_ES)
     // Bail if GLES3 was requested but cannot be provided.
     if (attributes.useGLES3 && !epoxy_is_desktop_gl() && epoxy_gl_version() < 30)
         return nullptr;
@@ -156,7 +156,7 @@
             // Bind canvas FBO.
             glBindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_fbo);
             m_state.boundFBO = m_fbo;
-#if USE(OPENGL_ES_2)
+#if USE(OPENGL_ES)
             if (m_attrs.depth)
                 glGenRenderbuffers(1, &m_depthBuffer);
             if (m_attrs.stencil)
@@ -167,7 +167,7 @@
         }
     }
 
-#if !USE(OPENGL_ES_2)
+#if !USE(OPENGL_ES)
     ::glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
 
     if (GLContext::current()->version() >= 320) {
@@ -238,7 +238,7 @@
             ::glDeleteRenderbuffers(1, &m_multisampleDepthStencilBuffer);
         ::glDeleteFramebuffers(1, &m_multisampleFBO);
     } else if (m_attrs.stencil || m_attrs.depth) {
-#if USE(OPENGL_ES_2)
+#if USE(OPENGL_ES)
         if (m_depthBuffer)
             glDeleteRenderbuffers(1, &m_depthBuffer);
 
@@ -289,7 +289,7 @@
 
 bool GraphicsContext3D::isGLES2Compliant() const
 {
-#if USE(OPENGL_ES_2)
+#if USE(OPENGL_ES)
     return true;
 #else
     return false;
@@ -305,7 +305,7 @@
 Extensions3D& GraphicsContext3D::getExtensions()
 {
     if (!m_extensions) {
-#if USE(OPENGL_ES_2)
+#if USE(OPENGL_ES)
         // glGetStringi is not available on GLES2.
         m_extensions = std::make_unique<Extensions3DOpenGLES>(this,  false);
 #else

Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperContextAttributes.cpp (228589 => 228590)


--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperContextAttributes.cpp	2018-02-17 00:46:52 UTC (rev 228589)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperContextAttributes.cpp	2018-02-17 00:48:36 UTC (rev 228590)
@@ -35,7 +35,7 @@
 
 void TextureMapperContextAttributes::initialize()
 {
-#if USE(OPENGL_ES_2)
+#if USE(OPENGL_ES)
     isGLES2Compliant = true;
 
     String extensionsString(reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS)));

Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp (228589 => 228590)


--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp	2018-02-17 00:46:52 UTC (rev 228589)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp	2018-02-17 00:48:36 UTC (rev 228590)
@@ -126,7 +126,7 @@
     for (auto& entry : m_vbos)
         glDeleteBuffers(1, &entry.value);
 
-#if !USE(OPENGL_ES_2)
+#if !USE(OPENGL_ES)
     if (GLContext::current()->version() >= 320 && m_vao)
         glDeleteVertexArrays(1, &m_vao);
 #endif
@@ -162,7 +162,7 @@
 
 GLuint TextureMapperGLData::getVAO()
 {
-#if !USE(OPENGL_ES_2)
+#if !USE(OPENGL_ES)
     if (GLContext::current()->version() >= 320 && !m_vao)
         glGenVertexArrays(1, &m_vao);
 #endif
@@ -212,7 +212,7 @@
     data().PaintFlags = flags;
     bindSurface(0);
 
-#if !USE(OPENGL_ES_2)
+#if !USE(OPENGL_ES)
     if (GLContext::current()->version() >= 320) {
         glGetIntegerv(GL_VERTEX_ARRAY_BINDING, &data().previousVAO);
         glBindVertexArray(data().getVAO());
@@ -240,7 +240,7 @@
     else
         glDisable(GL_DEPTH_TEST);
 
-#if !USE(OPENGL_ES_2)
+#if !USE(OPENGL_ES)
     if (GLContext::current()->version() >= 320)
         glBindVertexArray(data().previousVAO);
 #endif

Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGLHeaders.h (228589 => 228590)


--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGLHeaders.h	2018-02-17 00:46:52 UTC (rev 228589)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGLHeaders.h	2018-02-17 00:48:36 UTC (rev 228590)
@@ -27,7 +27,7 @@
 
 #if USE(LIBEPOXY)
 #include <epoxy/gl.h>
-#elif USE(OPENGL_ES_2)
+#elif USE(OPENGL_ES)
 #define GL_GLEXT_PROTOTYPES 1
 #include <GLES2/gl2.h>
 #else

Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.cpp (228589 => 228590)


--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.cpp	2018-02-17 00:46:52 UTC (rev 228589)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.cpp	2018-02-17 00:48:36 UTC (rev 228590)
@@ -55,10 +55,10 @@
 // Input/output variables definition for both GLES and OpenGL < 3.2.
 // The default precision directive is only needed for GLES.
 static const char* vertexTemplateLT320Vars =
-#if USE(OPENGL_ES_2)
+#if USE(OPENGL_ES)
     TEXTURE_SPACE_MATRIX_PRECISION_DIRECTIVE
 #endif
-#if USE(OPENGL_ES_2)
+#if USE(OPENGL_ES)
     STRINGIFY(
         precision TextureSpaceMatrixPrecision float;
     )
@@ -70,7 +70,7 @@
         varying float v_antialias;
     );
 
-#if !USE(OPENGL_ES_2)
+#if !USE(OPENGL_ES)
 // Input/output variables definition for OpenGL >= 3.2.
 static const char* vertexTemplateGE320Vars =
     STRINGIFY(
@@ -167,10 +167,10 @@
     RECT_TEXTURE_DIRECTIVE
     ANTIALIASING_TEX_COORD_DIRECTIVE
     BLUR_CONSTANTS
-#if USE(OPENGL_ES_2)
+#if USE(OPENGL_ES)
     TEXTURE_SPACE_MATRIX_PRECISION_DIRECTIVE
 #endif
-#if USE(OPENGL_ES_2)
+#if USE(OPENGL_ES)
     STRINGIFY(
         precision TextureSpaceMatrixPrecision float;
     )
@@ -179,7 +179,7 @@
         uniform mat4 u_textureSpaceMatrix;
         uniform mat4 u_textureColorSpaceMatrix;
     )
-#if USE(OPENGL_ES_2)
+#if USE(OPENGL_ES)
     STRINGIFY(
         precision mediump float;
     )
@@ -194,7 +194,7 @@
         varying vec2 v_transformedTexCoord;
     );
 
-#if !USE(OPENGL_ES_2)
+#if !USE(OPENGL_ES)
 // Input/output variables definition for OpenGL >= 3.2.
 static const char* fragmentTemplateGE320Vars =
     STRINGIFY(
@@ -390,7 +390,7 @@
     StringBuilder vertexShaderBuilder;
 
     // OpenGL >= 3.2 requires a #version directive at the beginning of the code.
-#if !USE(OPENGL_ES_2)
+#if !USE(OPENGL_ES)
     unsigned glVersion = GLContext::current()->version();
     if (glVersion >= 320)
         vertexShaderBuilder.append(GLSL_DIRECTIVE(version 150));
@@ -400,7 +400,7 @@
     vertexShaderBuilder.append(optionsApplierBuilder.toString());
 
     // Append the appropriate input/output variable definitions.
-#if USE(OPENGL_ES_2)
+#if USE(OPENGL_ES)
     vertexShaderBuilder.append(vertexTemplateLT320Vars);
 #else
     if (glVersion >= 320)
@@ -415,7 +415,7 @@
     StringBuilder fragmentShaderBuilder;
 
     // OpenGL >= 3.2 requires a #version directive at the beginning of the code.
-#if !USE(OPENGL_ES_2)
+#if !USE(OPENGL_ES)
     if (glVersion >= 320)
         fragmentShaderBuilder.append(GLSL_DIRECTIVE(version 150));
 #endif
@@ -427,7 +427,7 @@
     fragmentShaderBuilder.append(fragmentTemplateHeaderCommon);
 
     // Append the appropriate input/output variable definitions.
-#if USE(OPENGL_ES_2)
+#if USE(OPENGL_ES)
     fragmentShaderBuilder.append(fragmentTemplateLT320Vars);
 #else
     if (glVersion >= 320)

Modified: trunk/Source/WebKit/CMakeLists.txt (228589 => 228590)


--- trunk/Source/WebKit/CMakeLists.txt	2018-02-17 00:46:52 UTC (rev 228589)
+++ trunk/Source/WebKit/CMakeLists.txt	2018-02-17 00:48:36 UTC (rev 228590)
@@ -745,7 +745,7 @@
                 ${OPENGL_LIBRARIES}
             )
             add_definitions(${OPENGL_DEFINITIONS})
-        elseif (USE_OPENGL_ES_2)
+        elseif (USE_OPENGL_ES)
             list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES
                 ${OPENGLES2_INCLUDE_DIRS}
             )

Modified: trunk/Source/WebKit/ChangeLog (228589 => 228590)


--- trunk/Source/WebKit/ChangeLog	2018-02-17 00:46:52 UTC (rev 228589)
+++ trunk/Source/WebKit/ChangeLog	2018-02-17 00:48:36 UTC (rev 228590)
@@ -1,3 +1,19 @@
+2018-02-16  Dean Jackson  <[email protected]>
+
+        Use OPENGL macros to be more clear about which OpenGL/ES WebGL uses on Cocoa
+        https://bugs.webkit.org/show_bug.cgi?id=182894
+
+        Reviewed by Tim Horton.
+
+        Rename OPENGL_ES_2 to OPENGL_ES.
+
+        * CMakeLists.txt:
+        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
+        * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
+        (WebKit::AcceleratedBackingStoreWayland::paint):
+        * UIProcess/gtk/WaylandCompositor.cpp:
+        (WebKit::WaylandCompositor::initializeEGL):
+
 2018-02-16  Ryosuke Niwa  <[email protected]>
 
         Add an entitlement check for service worker on iOS

Modified: trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp (228589 => 228590)


--- trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp	2018-02-17 00:46:52 UTC (rev 228589)
+++ trunk/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp	2018-02-17 00:48:36 UTC (rev 228590)
@@ -36,7 +36,7 @@
 
 #if USE(LIBEPOXY)
 #include <epoxy/gl.h>
-#elif USE(OPENGL_ES_2)
+#elif USE(OPENGL_ES)
 #include <GLES2/gl2.h>
 #else
 #include <GL/gl.h>

Modified: trunk/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreWayland.cpp (228589 => 228590)


--- trunk/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreWayland.cpp	2018-02-17 00:46:52 UTC (rev 228589)
+++ trunk/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreWayland.cpp	2018-02-17 00:48:36 UTC (rev 228590)
@@ -33,7 +33,7 @@
 #include <WebCore/CairoUtilities.h>
 #include <WebCore/RefPtrCairo.h>
 
-#if USE(OPENGL_ES_2)
+#if USE(OPENGL_ES)
 #include <GLES2/gl2.h>
 #else
 #include <WebCore/OpenGLShims.h>
@@ -116,7 +116,7 @@
 
     glPixelStorei(GL_PACK_ALIGNMENT, 4);
 
-#if USE(OPENGL_ES_2)
+#if USE(OPENGL_ES)
     unsigned char* data = ""
     if (cairo_image_surface_get_stride(m_surface.get()) == textureSize.width() * 4)
         glReadPixels(0, 0, textureSize.width(), textureSize.height(), GL_RGBA, GL_UNSIGNED_BYTE, data);

Modified: trunk/Source/WebKit/UIProcess/gtk/WaylandCompositor.cpp (228589 => 228590)


--- trunk/Source/WebKit/UIProcess/gtk/WaylandCompositor.cpp	2018-02-17 00:46:52 UTC (rev 228589)
+++ trunk/Source/WebKit/UIProcess/gtk/WaylandCompositor.cpp	2018-02-17 00:48:36 UTC (rev 228590)
@@ -37,7 +37,7 @@
 #include <wayland-server-protocol.h>
 #include <wtf/UUID.h>
 
-#if USE(OPENGL_ES_2)
+#if USE(OPENGL_ES)
 #include <GLES2/gl2.h>
 #include <GLES2/gl2ext.h>
 #include <WebCore/Extensions3DOpenGLES.h>
@@ -407,7 +407,7 @@
     if (!m_eglContext->makeContextCurrent())
         return false;
 
-#if USE(OPENGL_ES_2)
+#if USE(OPENGL_ES)
     std::unique_ptr<Extensions3DOpenGLES> glExtensions = std::make_unique<Extensions3DOpenGLES>(nullptr,  false);
 #else
     std::unique_ptr<Extensions3DOpenGL> glExtensions = std::make_unique<Extensions3DOpenGL>(nullptr, GLContext::current()->version() >= 320);

Modified: trunk/Source/WebKitLegacy/win/ChangeLog (228589 => 228590)


--- trunk/Source/WebKitLegacy/win/ChangeLog	2018-02-17 00:46:52 UTC (rev 228589)
+++ trunk/Source/WebKitLegacy/win/ChangeLog	2018-02-17 00:48:36 UTC (rev 228590)
@@ -1,3 +1,14 @@
+2018-02-16  Dean Jackson  <[email protected]>
+
+        Use OPENGL macros to be more clear about which OpenGL/ES WebGL uses on Cocoa
+        https://bugs.webkit.org/show_bug.cgi?id=182894
+
+        Reviewed by Tim Horton.
+
+        Rename OPENGL_ES_2 to OPENGL_ES.
+
+        * WebCoreSupport/AcceleratedCompositingContext.cpp:
+
 2018-02-16  Youenn Fablet  <[email protected]>
 
         Allow specifying which plug-ins are supported

Modified: trunk/Source/WebKitLegacy/win/WebCoreSupport/AcceleratedCompositingContext.cpp (228589 => 228590)


--- trunk/Source/WebKitLegacy/win/WebCoreSupport/AcceleratedCompositingContext.cpp	2018-02-17 00:46:52 UTC (rev 228589)
+++ trunk/Source/WebKitLegacy/win/WebCoreSupport/AcceleratedCompositingContext.cpp	2018-02-17 00:48:36 UTC (rev 228590)
@@ -43,7 +43,7 @@
 #include <WebCore/TextureMapperGL.h>
 #include <WebCore/TextureMapperLayer.h>
 
-#if USE(OPENGL_ES_2)
+#if USE(OPENGL_ES)
 #define GL_GLEXT_PROTOTYPES 1
 #include <GLES2/gl2.h>
 #else

Modified: trunk/Source/cmake/OptionsGTK.cmake (228589 => 228590)


--- trunk/Source/cmake/OptionsGTK.cmake	2018-02-17 00:46:52 UTC (rev 228589)
+++ trunk/Source/cmake/OptionsGTK.cmake	2018-02-17 00:48:36 UTC (rev 228590)
@@ -246,7 +246,7 @@
     # But USE_OPENGL is the opposite of ENABLE_GLES2.
     if (ENABLE_GLES2)
         find_package(OpenGLES2 REQUIRED)
-        SET_AND_EXPOSE_TO_BUILD(USE_OPENGL_ES_2 TRUE)
+        SET_AND_EXPOSE_TO_BUILD(USE_OPENGL_ES TRUE)
 
         if (NOT EGL_FOUND)
             message(FATAL_ERROR "EGL is needed for ENABLE_GLES2.")

Modified: trunk/Source/cmake/OptionsWPE.cmake (228589 => 228590)


--- trunk/Source/cmake/OptionsWPE.cmake	2018-02-17 00:46:52 UTC (rev 228589)
+++ trunk/Source/cmake/OptionsWPE.cmake	2018-02-17 00:48:36 UTC (rev 228590)
@@ -97,7 +97,7 @@
 SET_AND_EXPOSE_TO_BUILD(USE_EGL TRUE)
 SET_AND_EXPOSE_TO_BUILD(USE_GCRYPT TRUE)
 SET_AND_EXPOSE_TO_BUILD(USE_LIBEPOXY TRUE)
-SET_AND_EXPOSE_TO_BUILD(USE_OPENGL_ES_2 TRUE)
+SET_AND_EXPOSE_TO_BUILD(USE_OPENGL_ES TRUE)
 SET_AND_EXPOSE_TO_BUILD(USE_XDGMIME TRUE)
 
 SET_AND_EXPOSE_TO_BUILD(ENABLE_GRAPHICS_CONTEXT_3D TRUE)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to