Change the NSGL skeleton to be a CGL skeleton
The previous skeleton was name NSGL because it seemed the easier route
to go, however Chrome uses CGL internally, which we want to match.
BUG=angleproject:891
Change-Id: I00eb597080c8b735545750dfcd6ad80dcea79300
Reviewed-on: https://chromium-review.googlesource.com/289870
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/libANGLE/Display.cpp b/src/libANGLE/Display.cpp
index 1817d3b..29eb731 100644
--- a/src/libANGLE/Display.cpp
+++ b/src/libANGLE/Display.cpp
@@ -39,7 +39,7 @@
# elif defined(ANGLE_USE_X11)
# include "libANGLE/renderer/gl/glx/DisplayGLX.h"
# elif defined(ANGLE_PLATFORM_APPLE)
-# include "libANGLE/renderer/gl/nsgl/DisplayNSGL.h"
+# include "libANGLE/renderer/gl/cgl/DisplayCGL.h"
# else
# error Unsupported OpenGL platform.
# endif
@@ -115,7 +115,7 @@
#elif defined(ANGLE_USE_X11)
impl = new rx::DisplayGLX();
#elif defined(ANGLE_PLATFORM_APPLE)
- impl = new rx::DisplayNSGL();
+ impl = new rx::DisplayCGL();
#else
// No display available
UNREACHABLE();
@@ -139,7 +139,7 @@
#elif defined(ANGLE_USE_X11)
impl = new rx::DisplayGLX();
#elif defined(ANGLE_PLATFORM_APPLE)
- impl = new rx::DisplayNSGL();
+ impl = new rx::DisplayCGL();
#else
#error Unsupported OpenGL platform.
#endif
diff --git a/src/libANGLE/renderer/gl/nsgl/DisplayNSGL.h b/src/libANGLE/renderer/gl/cgl/DisplayCGL.h
similarity index 85%
rename from src/libANGLE/renderer/gl/nsgl/DisplayNSGL.h
rename to src/libANGLE/renderer/gl/cgl/DisplayCGL.h
index 54c8090..4a673b2 100644
--- a/src/libANGLE/renderer/gl/nsgl/DisplayNSGL.h
+++ b/src/libANGLE/renderer/gl/cgl/DisplayCGL.h
@@ -4,21 +4,21 @@
// found in the LICENSE file.
//
-// DisplayNSGL.h: NSOpenGL implementation of egl::Display
+// DisplayCGL.h: CGL implementation of egl::Display
-#ifndef LIBANGLE_RENDERER_GL_NSGL_DISPLAYNSGL_H_
-#define LIBANGLE_RENDERER_GL_NSGL_DISPLAYNSGL_H_
+#ifndef LIBANGLE_RENDERER_GL_CGL_DISPLAYCGL_H_
+#define LIBANGLE_RENDERER_GL_CGL_DISPLAYCGL_H_
#include "libANGLE/renderer/gl/DisplayGL.h"
namespace rx
{
-class DisplayNSGL : public DisplayGL
+class DisplayCGL : public DisplayGL
{
public:
- DisplayNSGL();
- ~DisplayNSGL() override;
+ DisplayCGL();
+ ~DisplayCGL() override;
egl::Error initialize(egl::Display *display) override;
void terminate() override;
@@ -58,4 +58,4 @@
}
-#endif // LIBANGLE_RENDERER_GL_NSGL_DISPLAYNSGL_H_
+#endif // LIBANGLE_RENDERER_GL_CGL_DISPLAYCGL_H_
diff --git a/src/libANGLE/renderer/gl/cgl/DisplayCGL.mm b/src/libANGLE/renderer/gl/cgl/DisplayCGL.mm
new file mode 100644
index 0000000..d400d78
--- /dev/null
+++ b/src/libANGLE/renderer/gl/cgl/DisplayCGL.mm
@@ -0,0 +1,129 @@
+//
+// Copyright (c) 2015 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+
+// DisplayCGL.mm: CGL implementation of egl::Display
+
+#include "libANGLE/renderer/gl/CGL/DisplayCGL.h"
+
+#include "common/debug.h"
+#include "libANGLE/renderer/gl/CGL/WindowSurfaceCGL.h"
+
+namespace rx
+{
+
+DisplayCGL::DisplayCGL()
+ : DisplayGL(),
+ mEGLDisplay(nullptr)
+{
+}
+
+DisplayCGL::~DisplayCGL()
+{
+}
+
+egl::Error DisplayCGL::initialize(egl::Display *display)
+{
+ UNIMPLEMENTED();
+ mEGLDisplay = display;
+ return DisplayGL::initialize(display);
+}
+
+void DisplayCGL::terminate()
+{
+ UNIMPLEMENTED();
+ DisplayGL::terminate();
+}
+
+SurfaceImpl *DisplayCGL::createWindowSurface(const egl::Config *configuration,
+ EGLNativeWindowType window,
+ const egl::AttributeMap &attribs)
+{
+ UNIMPLEMENTED();
+ return new WindowSurfaceCGL();
+}
+
+SurfaceImpl *DisplayCGL::createPbufferSurface(const egl::Config *configuration,
+ const egl::AttributeMap &attribs)
+{
+ UNIMPLEMENTED();
+ return nullptr;
+}
+
+SurfaceImpl* DisplayCGL::createPbufferFromClientBuffer(const egl::Config *configuration,
+ EGLClientBuffer shareHandle,
+ const egl::AttributeMap &attribs)
+{
+ UNIMPLEMENTED();
+ return nullptr;
+}
+
+SurfaceImpl *DisplayCGL::createPixmapSurface(const egl::Config *configuration,
+ NativePixmapType nativePixmap,
+ const egl::AttributeMap &attribs)
+{
+ UNIMPLEMENTED();
+ return nullptr;
+}
+
+egl::Error DisplayCGL::getDevice(DeviceImpl **device)
+{
+ UNIMPLEMENTED();
+ return egl::Error(EGL_BAD_DISPLAY);
+}
+
+egl::ConfigSet DisplayCGL::generateConfigs() const
+{
+ UNIMPLEMENTED();
+ egl::ConfigSet configs;
+ return configs;
+}
+
+bool DisplayCGL::isDeviceLost() const
+{
+ UNIMPLEMENTED();
+ return false;
+}
+
+bool DisplayCGL::testDeviceLost()
+{
+ UNIMPLEMENTED();
+ return false;
+}
+
+egl::Error DisplayCGL::restoreLostDevice()
+{
+ UNIMPLEMENTED();
+ return egl::Error(EGL_BAD_DISPLAY);
+}
+
+bool DisplayCGL::isValidNativeWindow(EGLNativeWindowType window) const
+{
+ UNIMPLEMENTED();
+ return true;
+}
+
+std::string DisplayCGL::getVendorString() const
+{
+ UNIMPLEMENTED();
+ return "";
+}
+
+const FunctionsGL *DisplayCGL::getFunctionsGL() const
+{
+ UNIMPLEMENTED();
+ return nullptr;
+}
+
+void DisplayCGL::generateExtensions(egl::DisplayExtensions *outExtensions) const
+{
+ UNIMPLEMENTED();
+}
+
+void DisplayCGL::generateCaps(egl::Caps *outCaps) const
+{
+ UNIMPLEMENTED();
+}
+}
diff --git a/src/libANGLE/renderer/gl/nsgl/WindowSurfaceNSGL.h b/src/libANGLE/renderer/gl/cgl/WindowSurfaceCGL.h
similarity index 70%
rename from src/libANGLE/renderer/gl/nsgl/WindowSurfaceNSGL.h
rename to src/libANGLE/renderer/gl/cgl/WindowSurfaceCGL.h
index 052e888..7eb20c0 100644
--- a/src/libANGLE/renderer/gl/nsgl/WindowSurfaceNSGL.h
+++ b/src/libANGLE/renderer/gl/cgl/WindowSurfaceCGL.h
@@ -4,21 +4,21 @@
// found in the LICENSE file.
//
-// WindowSurfaceNSGL.h: NSOpenGL implementation of egl::Surface for windows
+// WindowSurfaceCGL.h: CGL implementation of egl::Surface for windows
-#ifndef LIBANGLE_RENDERER_GL_NSGL_WINDOWSURFACENSGL_H_
-#define LIBANGLE_RENDERER_GL_NSGL_WINDOWSURFACENSGL_H_
+#ifndef LIBANGLE_RENDERER_GL_CGL_WINDOWSURFACECGL_H_
+#define LIBANGLE_RENDERER_GL_CGL_WINDOWSURFACECGL_H_
#include "libANGLE/renderer/gl/SurfaceGL.h"
namespace rx
{
-class WindowSurfaceNSGL : public SurfaceGL
+class WindowSurfaceCGL : public SurfaceGL
{
public:
- WindowSurfaceNSGL();
- ~WindowSurfaceNSGL() override;
+ WindowSurfaceCGL();
+ ~WindowSurfaceCGL() override;
egl::Error initialize() override;
egl::Error makeCurrent() override;
@@ -38,4 +38,4 @@
}
-#endif // LIBANGLE_RENDERER_GL_NSGL_WINDOWSURFACENSGL_H_
+#endif // LIBANGLE_RENDERER_GL_CGL_WINDOWSURFACECGL_H_
diff --git a/src/libANGLE/renderer/gl/cgl/WindowSurfaceCGL.mm b/src/libANGLE/renderer/gl/cgl/WindowSurfaceCGL.mm
new file mode 100644
index 0000000..1034540
--- /dev/null
+++ b/src/libANGLE/renderer/gl/cgl/WindowSurfaceCGL.mm
@@ -0,0 +1,90 @@
+//
+// Copyright (c) 2015 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+
+// WindowSurfaceCGL.cpp: CGL implementation of egl::Surface for windows
+
+#include "libANGLE/renderer/gl/cgl/WindowSurfaceCGL.h"
+
+#include "common/debug.h"
+
+namespace rx
+{
+
+WindowSurfaceCGL::WindowSurfaceCGL()
+ : SurfaceGL()
+{
+}
+
+WindowSurfaceCGL::~WindowSurfaceCGL()
+{
+}
+
+egl::Error WindowSurfaceCGL::initialize()
+{
+ UNIMPLEMENTED();
+ return egl::Error(EGL_SUCCESS);
+}
+
+egl::Error WindowSurfaceCGL::makeCurrent()
+{
+ UNIMPLEMENTED();
+ return egl::Error(EGL_SUCCESS);
+}
+
+egl::Error WindowSurfaceCGL::swap()
+{
+ UNIMPLEMENTED();
+ return egl::Error(EGL_SUCCESS);
+}
+
+egl::Error WindowSurfaceCGL::postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height)
+{
+ UNIMPLEMENTED();
+ return egl::Error(EGL_SUCCESS);
+}
+
+egl::Error WindowSurfaceCGL::querySurfacePointerANGLE(EGLint attribute, void **value)
+{
+ UNIMPLEMENTED();
+ return egl::Error(EGL_SUCCESS);
+}
+
+egl::Error WindowSurfaceCGL::bindTexImage(EGLint buffer)
+{
+ UNIMPLEMENTED();
+ return egl::Error(EGL_SUCCESS);
+}
+
+egl::Error WindowSurfaceCGL::releaseTexImage(EGLint buffer)
+{
+ UNIMPLEMENTED();
+ return egl::Error(EGL_SUCCESS);
+}
+
+void WindowSurfaceCGL::setSwapInterval(EGLint interval)
+{
+ UNIMPLEMENTED();
+}
+
+EGLint WindowSurfaceCGL::getWidth() const
+{
+ UNIMPLEMENTED();
+ return 0;
+}
+
+EGLint WindowSurfaceCGL::getHeight() const
+{
+ UNIMPLEMENTED();
+ return 0;
+}
+
+EGLint WindowSurfaceCGL::isPostSubBufferSupported() const
+{
+ UNIMPLEMENTED();
+ return EGL_FALSE;
+}
+
+}
diff --git a/src/libANGLE/renderer/gl/nsgl/DisplayNSGL.mm b/src/libANGLE/renderer/gl/nsgl/DisplayNSGL.mm
deleted file mode 100644
index cf876b3..0000000
--- a/src/libANGLE/renderer/gl/nsgl/DisplayNSGL.mm
+++ /dev/null
@@ -1,129 +0,0 @@
-//
-// Copyright (c) 2015 The ANGLE Project Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-
-// DisplayNSGL.mm: NSOpenGL implementation of egl::Display
-
-#include "libANGLE/renderer/gl/nsgl/DisplayNSGL.h"
-
-#include "common/debug.h"
-#include "libANGLE/renderer/gl/nsgl/WindowSurfaceNSGL.h"
-
-namespace rx
-{
-
-DisplayNSGL::DisplayNSGL()
- : DisplayGL(),
- mEGLDisplay(nullptr)
-{
-}
-
-DisplayNSGL::~DisplayNSGL()
-{
-}
-
-egl::Error DisplayNSGL::initialize(egl::Display *display)
-{
- UNIMPLEMENTED();
- mEGLDisplay = display;
- return DisplayGL::initialize(display);
-}
-
-void DisplayNSGL::terminate()
-{
- UNIMPLEMENTED();
- DisplayGL::terminate();
-}
-
-SurfaceImpl *DisplayNSGL::createWindowSurface(const egl::Config *configuration,
- EGLNativeWindowType window,
- const egl::AttributeMap &attribs)
-{
- UNIMPLEMENTED();
- return new WindowSurfaceNSGL();
-}
-
-SurfaceImpl *DisplayNSGL::createPbufferSurface(const egl::Config *configuration,
- const egl::AttributeMap &attribs)
-{
- UNIMPLEMENTED();
- return nullptr;
-}
-
-SurfaceImpl* DisplayNSGL::createPbufferFromClientBuffer(const egl::Config *configuration,
- EGLClientBuffer shareHandle,
- const egl::AttributeMap &attribs)
-{
- UNIMPLEMENTED();
- return nullptr;
-}
-
-SurfaceImpl *DisplayNSGL::createPixmapSurface(const egl::Config *configuration,
- NativePixmapType nativePixmap,
- const egl::AttributeMap &attribs)
-{
- UNIMPLEMENTED();
- return nullptr;
-}
-
-egl::Error DisplayNSGL::getDevice(DeviceImpl **device)
-{
- UNIMPLEMENTED();
- return egl::Error(EGL_BAD_DISPLAY);
-}
-
-egl::ConfigSet DisplayNSGL::generateConfigs() const
-{
- UNIMPLEMENTED();
- egl::ConfigSet configs;
- return configs;
-}
-
-bool DisplayNSGL::isDeviceLost() const
-{
- UNIMPLEMENTED();
- return false;
-}
-
-bool DisplayNSGL::testDeviceLost()
-{
- UNIMPLEMENTED();
- return false;
-}
-
-egl::Error DisplayNSGL::restoreLostDevice()
-{
- UNIMPLEMENTED();
- return egl::Error(EGL_BAD_DISPLAY);
-}
-
-bool DisplayNSGL::isValidNativeWindow(EGLNativeWindowType window) const
-{
- UNIMPLEMENTED();
- return true;
-}
-
-std::string DisplayNSGL::getVendorString() const
-{
- UNIMPLEMENTED();
- return "";
-}
-
-const FunctionsGL *DisplayNSGL::getFunctionsGL() const
-{
- UNIMPLEMENTED();
- return nullptr;
-}
-
-void DisplayNSGL::generateExtensions(egl::DisplayExtensions *outExtensions) const
-{
- UNIMPLEMENTED();
-}
-
-void DisplayNSGL::generateCaps(egl::Caps *outCaps) const
-{
- UNIMPLEMENTED();
-}
-}
diff --git a/src/libANGLE/renderer/gl/nsgl/WindowSurfaceNSGL.mm b/src/libANGLE/renderer/gl/nsgl/WindowSurfaceNSGL.mm
deleted file mode 100644
index 5c8aead..0000000
--- a/src/libANGLE/renderer/gl/nsgl/WindowSurfaceNSGL.mm
+++ /dev/null
@@ -1,90 +0,0 @@
-//
-// Copyright (c) 2015 The ANGLE Project Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-
-// WindowSurfaceNSGL.cpp: NSGL implementation of egl::Surface for windows
-
-#include "libANGLE/renderer/gl/nsgl/WindowSurfaceNSGL.h"
-
-#include "common/debug.h"
-
-namespace rx
-{
-
-WindowSurfaceNSGL::WindowSurfaceNSGL()
- : SurfaceGL()
-{
-}
-
-WindowSurfaceNSGL::~WindowSurfaceNSGL()
-{
-}
-
-egl::Error WindowSurfaceNSGL::initialize()
-{
- UNIMPLEMENTED();
- return egl::Error(EGL_SUCCESS);
-}
-
-egl::Error WindowSurfaceNSGL::makeCurrent()
-{
- UNIMPLEMENTED();
- return egl::Error(EGL_SUCCESS);
-}
-
-egl::Error WindowSurfaceNSGL::swap()
-{
- UNIMPLEMENTED();
- return egl::Error(EGL_SUCCESS);
-}
-
-egl::Error WindowSurfaceNSGL::postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height)
-{
- UNIMPLEMENTED();
- return egl::Error(EGL_SUCCESS);
-}
-
-egl::Error WindowSurfaceNSGL::querySurfacePointerANGLE(EGLint attribute, void **value)
-{
- UNIMPLEMENTED();
- return egl::Error(EGL_SUCCESS);
-}
-
-egl::Error WindowSurfaceNSGL::bindTexImage(EGLint buffer)
-{
- UNIMPLEMENTED();
- return egl::Error(EGL_SUCCESS);
-}
-
-egl::Error WindowSurfaceNSGL::releaseTexImage(EGLint buffer)
-{
- UNIMPLEMENTED();
- return egl::Error(EGL_SUCCESS);
-}
-
-void WindowSurfaceNSGL::setSwapInterval(EGLint interval)
-{
- UNIMPLEMENTED();
-}
-
-EGLint WindowSurfaceNSGL::getWidth() const
-{
- UNIMPLEMENTED();
- return 0;
-}
-
-EGLint WindowSurfaceNSGL::getHeight() const
-{
- UNIMPLEMENTED();
- return 0;
-}
-
-EGLint WindowSurfaceNSGL::isPostSubBufferSupported() const
-{
- UNIMPLEMENTED();
- return EGL_FALSE;
-}
-
-}
diff --git a/src/libGLESv2.gypi b/src/libGLESv2.gypi
index 6d2e55c..b1681d5 100644
--- a/src/libGLESv2.gypi
+++ b/src/libGLESv2.gypi
@@ -454,12 +454,12 @@
'libANGLE/renderer/gl/glx/functionsglx_typedefs.h',
'libANGLE/renderer/gl/glx/platform_glx.h',
],
- 'libangle_gl_nsgl_sources':
+ 'libangle_gl_cgl_sources':
[
- 'libANGLE/renderer/gl/nsgl/DisplayNSGL.mm',
- 'libANGLE/renderer/gl/nsgl/DisplayNSGL.h',
- 'libANGLE/renderer/gl/nsgl/WindowSurfaceNSGL.mm',
- 'libANGLE/renderer/gl/nsgl/WindowSurfaceNSGL.h',
+ 'libANGLE/renderer/gl/cgl/DisplayCGL.mm',
+ 'libANGLE/renderer/gl/cgl/DisplayCGL.h',
+ 'libANGLE/renderer/gl/cgl/WindowSurfaceCGL.mm',
+ 'libANGLE/renderer/gl/cgl/WindowSurfaceCGL.h',
],
'libglesv2_sources':
[
@@ -710,7 +710,7 @@
{
'sources':
[
- '<@(libangle_gl_nsgl_sources)',
+ '<@(libangle_gl_cgl_sources)',
],
}],
],