Use OPENGL macros to be more clear about which OpenGL/ES WebGL uses on Cocoa
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 17 Feb 2018 00:48:36 +0000 (00:48 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 17 Feb 2018 00:48:36 +0000 (00:48 +0000)
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).

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228590 268f45cc-cd09-0410-ab3c-d52691b4dbfc

41 files changed:
ChangeLog
PerformanceTests/ChangeLog
PerformanceTests/StitchMarker/wtf/Platform.h
Source/WTF/ChangeLog
Source/WTF/wtf/Platform.h
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/PlatformGTK.cmake
Source/WebCore/platform/graphics/ANGLEWebKitBridge.h
Source/WebCore/platform/graphics/GLContext.cpp
Source/WebCore/platform/graphics/GraphicsContext3D.h
Source/WebCore/platform/graphics/GraphicsContext3DPrivate.cpp
Source/WebCore/platform/graphics/OpenGLESShims.h
Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp
Source/WebCore/platform/graphics/egl/GLContextEGL.cpp
Source/WebCore/platform/graphics/egl/GLContextEGLWPE.cpp
Source/WebCore/platform/graphics/egl/GLContextEGLWayland.cpp
Source/WebCore/platform/graphics/egl/GLContextEGLX11.cpp
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp
Source/WebCore/platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp
Source/WebCore/platform/graphics/gstreamer/VideoTextureCopierGStreamer.h
Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp
Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp
Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.h
Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp
Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp
Source/WebCore/platform/graphics/opengl/TemporaryOpenGLSetting.cpp
Source/WebCore/platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp
Source/WebCore/platform/graphics/texmap/TextureMapperContextAttributes.cpp
Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp
Source/WebCore/platform/graphics/texmap/TextureMapperGLHeaders.h
Source/WebCore/platform/graphics/texmap/TextureMapperShaderProgram.cpp
Source/WebKit/CMakeLists.txt
Source/WebKit/ChangeLog
Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp
Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreWayland.cpp
Source/WebKit/UIProcess/gtk/WaylandCompositor.cpp
Source/WebKitLegacy/win/ChangeLog
Source/WebKitLegacy/win/WebCoreSupport/AcceleratedCompositingContext.cpp
Source/cmake/OptionsGTK.cmake
Source/cmake/OptionsWPE.cmake

index 7bdc892..2daf217 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2018-02-16  Dean Jackson  <dino@apple.com>
+
+        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  <ross.kirsling@sony.com>
 
         Simplify .gitignore's WebKitLibraries/win section.
index 9702284..53ff235 100644 (file)
@@ -1,3 +1,14 @@
+2018-02-16  Dean Jackson  <dino@apple.com>
+
+        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  <rniwa@webkit.org>
 
         Make run-perf-tests work with Speedometer 2.0 and re-enable the test
index 309fc14..44b1840 100644 (file)
 
 #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
 
index c7d3500..8f8f903 100644 (file)
@@ -1,3 +1,18 @@
+2018-02-16  Dean Jackson  <dino@apple.com>
+
+        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  <fpizlo@apple.com>
 
         Unreviewed, roll out r228306 (custom memcpy/memset) because the bots say that it was not a
index b8cd8c4..ea79a15 100644 (file)
 #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
 
index 8f252dd..150237e 100644 (file)
@@ -1341,7 +1341,7 @@ if (ENABLE_GRAPHICS_CONTEXT_3D)
                 ${OPENGL_LIBRARIES}
             )
             add_definitions(${OPENGL_DEFINITIONS})
-        elseif (USE_OPENGL_ES_2)
+        elseif (USE_OPENGL_ES)
             list(APPEND WebCore_SYSTEM_INCLUDE_DIRECTORIES
                 ${OPENGLES2_INCLUDE_DIRS}
             )
index 0c4248a..425dcf2 100644 (file)
@@ -1,3 +1,61 @@
+2018-02-16  Dean Jackson  <dino@apple.com>
+
+        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  <zalan@apple.com>
 
         [RenderTreeBuilder] Move RenderElement::insertChildInternal() to RenderTreeBuilder
index 32c6ccc..a6f77f7 100644 (file)
@@ -128,7 +128,7 @@ list(APPEND WebCore_SYSTEM_INCLUDE_DIRECTORIES
     ${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
index dd4d60e..3823591 100644 (file)
 #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
index 599dcc0..01d4b07 100644 (file)
@@ -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 @@ inline ThreadGlobalGLContext* currentContext()
 
 static bool initializeOpenGLShimsIfNeeded()
 {
-#if USE(OPENGL_ES_2) || USE(LIBEPOXY)
+#if USE(OPENGL_ES) || USE(LIBEPOXY)
     return true;
 #else
     static bool initialized = false;
index 533ed93..03cd4c6 100644 (file)
@@ -86,7 +86,7 @@ const Platform3DObject NullPlatform3DObject = 0;
 
 namespace WebCore {
 class Extensions3D;
-#if USE(OPENGL_ES_2)
+#if !PLATFORM(COCOA) && USE(OPENGL_ES)
 class Extensions3DOpenGLES;
 #else
 class Extensions3DOpenGL;
@@ -1394,7 +1394,7 @@ private:
 
     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
index ce3703b..d1286db 100644 (file)
@@ -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
index bdee33a..9d82f72 100644 (file)
@@ -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
index d8cb5de..f50b4be 100644 (file)
@@ -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"
index 9c36085..e50e4bb 100644 (file)
@@ -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>
 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 @@ const char* GLContextEGL::lastErrorString()
 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 @@ std::unique_ptr<GLContextEGL> GLContextEGL::createContext(GLNativeWindowType win
     }
 
     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 @@ std::unique_ptr<GLContextEGL> GLContextEGL::createSharingContext(PlatformDisplay
     }
 
     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());
index f4dafb2..cb64237 100644 (file)
@@ -54,7 +54,7 @@ std::unique_ptr<GLContextEGL> GLContextEGL::createWPEContext(PlatformDisplay& pl
     }
 
     static const EGLint contextAttributes[] = {
-#if USE(OPENGL_ES_2)
+#if USE(OPENGL_ES)
         EGL_CONTEXT_CLIENT_VERSION, 2,
 #endif
         EGL_NONE
index a0ed56f..cd38680 100644 (file)
@@ -52,7 +52,7 @@ std::unique_ptr<GLContextEGL> GLContextEGL::createWaylandContext(PlatformDisplay
         return nullptr;
 
     static const EGLint contextAttributes[] = {
-#if USE(OPENGL_ES_2)
+#if USE(OPENGL_ES)
         EGL_CONTEXT_CLIENT_VERSION, 2,
 #endif
         EGL_NONE
index 8fdd4ca..caaf9e2 100644 (file)
@@ -50,7 +50,7 @@ std::unique_ptr<GLContextEGL> GLContextEGL::createPixmapContext(PlatformDisplay&
         return nullptr;
 
     static const EGLint contextAttributes[] = {
-#if USE(OPENGL_ES_2)
+#if USE(OPENGL_ES)
         EGL_CONTEXT_CLIENT_VERSION, 2,
 #endif
         EGL_NONE
index a16543a..b4a280d 100644 (file)
@@ -466,7 +466,7 @@ bool MediaPlayerPrivateGStreamerBase::ensureGstGLContext()
     // 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;
index b4d7832..135333e 100644 (file)
@@ -40,7 +40,7 @@ VideoTextureCopierGStreamer::VideoTextureCopierGStreamer(ColorConversion colorCo
     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 @@ VideoTextureCopierGStreamer::~VideoTextureCopierGStreamer()
     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 @@ bool VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture(GLuint input
     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
index f779537..ed1d58f 100644 (file)
@@ -52,7 +52,7 @@ private:
     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 };
index cb6c844..b9d0f7e 100644 (file)
 #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 @@ String Extensions3DOpenGLCommon::getTranslatedShaderSourceANGLE(Platform3DObject
 
 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);
index 15b89fb..ad80743 100644 (file)
@@ -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 @@ String Extensions3DOpenGLES::getExtensions()
 
 #endif // ENABLE(GRAPHICS_CONTEXT_3D)
 
-#endif // USE(OPENGL_ES_2)
+#endif // USE(OPENGL_ES)
index 8c493c0..b634d02 100644 (file)
@@ -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 @@ protected:
 
 } // namespace WebCore
 
-#endif // USE(OPENGL_ES_2)
+#endif // USE(OPENGL_ES)
index acf181e..df0a0b8 100644 (file)
@@ -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"
 #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>
 #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 @@ bool GraphicsContext3D::checkVaryingsPacking(Platform3DObject vertexShader, Plat
         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 @@ Platform3DObject GraphicsContext3D::createVertexArray()
 {
     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 @@ void GraphicsContext3D::deleteVertexArray(Platform3DObject array)
         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 @@ GC3Dboolean GraphicsContext3D::isVertexArray(Platform3DObject array)
         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 @@ GC3Dboolean GraphicsContext3D::isVertexArray(Platform3DObject array)
 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 @@ void GraphicsContext3D::texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xo
 {
     makeContextCurrent();
 
-#if !PLATFORM(IOS) && !USE(OPENGL_ES_2)
+#if !USE(OPENGL_ES)
     if (type == HALF_FLOAT_OES)
         type = GL_HALF_FLOAT_ARB;
 #endif
index 2d21f04..b0f5b3c 100644 (file)
@@ -263,7 +263,7 @@ RefPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3DAttributes
     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 @@ GraphicsContext3D::GraphicsContext3D(GraphicsContext3DAttributes attributes, Hos
     
     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 @@ Platform3DObject GraphicsContext3D::platformTexture() const
 
 bool GraphicsContext3D::isGLES2Compliant() const
 {
-#if USE(OPENGL_ES_2)
+#if USE(OPENGL_ES)
     return true;
 #else
     return false;
index f11db41..f2ea713 100644 (file)
 
 #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
index af107f6..0c083de 100644 (file)
 
 #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 @@ RefPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3DAttributes
     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 @@ RefPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3DAttributes
     // 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 @@ GraphicsContext3D::GraphicsContext3D(GraphicsContext3DAttributes attributes, Hos
             // 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 @@ GraphicsContext3D::GraphicsContext3D(GraphicsContext3DAttributes attributes, Hos
         }
     }
 
-#if !USE(OPENGL_ES_2)
+#if !USE(OPENGL_ES)
     ::glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
 
     if (GLContext::current()->version() >= 320) {
@@ -238,7 +238,7 @@ GraphicsContext3D::~GraphicsContext3D()
             ::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 @@ Platform3DObject GraphicsContext3D::platformTexture() const
 
 bool GraphicsContext3D::isGLES2Compliant() const
 {
-#if USE(OPENGL_ES_2)
+#if USE(OPENGL_ES)
     return true;
 #else
     return false;
@@ -305,7 +305,7 @@ PlatformLayer* GraphicsContext3D::platformLayer() const
 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
index f03cf06..4c3bc49 100644 (file)
@@ -35,7 +35,7 @@ namespace WebCore {
 
 void TextureMapperContextAttributes::initialize()
 {
-#if USE(OPENGL_ES_2)
+#if USE(OPENGL_ES)
     isGLES2Compliant = true;
 
     String extensionsString(reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS)));
index 5eddaf3..bfd2ce8 100644 (file)
@@ -126,7 +126,7 @@ TextureMapperGLData::~TextureMapperGLData()
     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::getStaticVBO(GLenum target, GLsizeiptr size, const v
 
 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 @@ void TextureMapperGL::beginPainting(PaintFlags flags)
     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 @@ void TextureMapperGL::endPainting()
     else
         glDisable(GL_DEPTH_TEST);
 
-#if !USE(OPENGL_ES_2)
+#if !USE(OPENGL_ES)
     if (GLContext::current()->version() >= 320)
         glBindVertexArray(data().previousVAO);
 #endif
index ad97079..53e2069 100644 (file)
@@ -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
index c9564c7..abedf53 100644 (file)
@@ -55,10 +55,10 @@ static inline bool compositingLogEnabled()
 // 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 @@ static const char* vertexTemplateLT320Vars =
         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 @@ static const char* fragmentTemplateHeaderCommon =
     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 @@ static const char* fragmentTemplateHeaderCommon =
         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 @@ static const char* fragmentTemplateLT320Vars =
         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 @@ Ref<TextureMapperShaderProgram> TextureMapperShaderProgram::create(TextureMapper
     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 @@ Ref<TextureMapperShaderProgram> TextureMapperShaderProgram::create(TextureMapper
     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 @@ Ref<TextureMapperShaderProgram> TextureMapperShaderProgram::create(TextureMapper
     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 @@ Ref<TextureMapperShaderProgram> TextureMapperShaderProgram::create(TextureMapper
     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)
index d98f3c4..a8b0c20 100644 (file)
@@ -745,7 +745,7 @@ if (ENABLE_GRAPHICS_CONTEXT_3D)
                 ${OPENGL_LIBRARIES}
             )
             add_definitions(${OPENGL_DEFINITIONS})
-        elseif (USE_OPENGL_ES_2)
+        elseif (USE_OPENGL_ES)
             list(APPEND WebKit_SYSTEM_INCLUDE_DIRECTORIES
                 ${OPENGLES2_INCLUDE_DIRS}
             )
index 0b5d0cd..03c2176 100644 (file)
@@ -1,3 +1,19 @@
+2018-02-16  Dean Jackson  <dino@apple.com>
+
+        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  <rniwa@webkit.org>
 
         Add an entitlement check for service worker on iOS
index 12e03c4..1043cf4 100644 (file)
@@ -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 @@ bool AcceleratedBackingStoreWayland::paint(cairo_t* cr, const IntRect& clipRect)
 
     glPixelStorei(GL_PACK_ALIGNMENT, 4);
 
-#if USE(OPENGL_ES_2)
+#if USE(OPENGL_ES)
     unsigned char* data = cairo_image_surface_get_data(m_surface.get());
     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);
index 4b5d22b..d6e172d 100644 (file)
@@ -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 @@ bool WaylandCompositor::initializeEGL()
     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);
index 788021e..061ffd3 100644 (file)
@@ -1,3 +1,14 @@
+2018-02-16  Dean Jackson  <dino@apple.com>
+
+        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  <youenn@apple.com>
 
         Allow specifying which plug-ins are supported
index 7a0c485..2391335 100644 (file)
@@ -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
index 1b3cf14..7cd8cc2 100644 (file)
@@ -246,7 +246,7 @@ if (ENABLE_OPENGL)
     # 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.")
index 5ef6b42..ed7d8cc 100644 (file)
@@ -97,7 +97,7 @@ SET_AND_EXPOSE_TO_BUILD(USE_CAIRO TRUE)
 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)