Commit 591516ff by Corentin Wallez

Add skeleton for DisplayNSGL and WindowSurfaceNSGL

BUG=angleproject:891 Change-Id: Ie79e76c68775e1144ac224a4f1eba85f8a889269 Reviewed-on: https://chromium-review.googlesource.com/286829Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarKenneth Russell <kbr@chromium.org> Tested-by: 's avatarCorentin Wallez <cwallez@chromium.org>
parent dcab33be
...@@ -32,6 +32,10 @@ ...@@ -32,6 +32,10 @@
{ {
'angle_enable_gl%': 1, 'angle_enable_gl%': 1,
}], }],
['OS=="mac"',
{
'angle_enable_gl%': 1,
}],
], ],
}, },
'includes': 'includes':
......
...@@ -38,6 +38,8 @@ ...@@ -38,6 +38,8 @@
# include "libANGLE/renderer/gl/wgl/DisplayWGL.h" # include "libANGLE/renderer/gl/wgl/DisplayWGL.h"
# elif defined(ANGLE_USE_X11) # elif defined(ANGLE_USE_X11)
# include "libANGLE/renderer/gl/glx/DisplayGLX.h" # include "libANGLE/renderer/gl/glx/DisplayGLX.h"
# elif defined(ANGLE_PLATFORM_APPLE)
# include "libANGLE/renderer/gl/nsgl/DisplayNSGL.h"
# else # else
# error Unsupported OpenGL platform. # error Unsupported OpenGL platform.
# endif # endif
...@@ -112,6 +114,8 @@ rx::DisplayImpl *CreateDisplayImpl(const AttributeMap &attribMap) ...@@ -112,6 +114,8 @@ rx::DisplayImpl *CreateDisplayImpl(const AttributeMap &attribMap)
impl = new rx::DisplayD3D(); impl = new rx::DisplayD3D();
#elif defined(ANGLE_USE_X11) #elif defined(ANGLE_USE_X11)
impl = new rx::DisplayGLX(); impl = new rx::DisplayGLX();
#elif defined(ANGLE_PLATFORM_APPLE)
impl = new rx::DisplayNSGL();
#else #else
// No display available // No display available
UNREACHABLE(); UNREACHABLE();
...@@ -134,6 +138,8 @@ rx::DisplayImpl *CreateDisplayImpl(const AttributeMap &attribMap) ...@@ -134,6 +138,8 @@ rx::DisplayImpl *CreateDisplayImpl(const AttributeMap &attribMap)
impl = new rx::DisplayWGL(); impl = new rx::DisplayWGL();
#elif defined(ANGLE_USE_X11) #elif defined(ANGLE_USE_X11)
impl = new rx::DisplayGLX(); impl = new rx::DisplayGLX();
#elif defined(ANGLE_PLATFORM_APPLE)
impl = new rx::DisplayNSGL();
#else #else
#error Unsupported OpenGL platform. #error Unsupported OpenGL platform.
#endif #endif
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
// found in the LICENSE file. // found in the LICENSE file.
// //
// DisplayGLX.h: GLX implementation of egl::Display // DisplayGLX.cpp: GLX implementation of egl::Display
#include "libANGLE/renderer/gl/glx/DisplayGLX.h" #include "libANGLE/renderer/gl/glx/DisplayGLX.h"
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
// found in the LICENSE file. // found in the LICENSE file.
// //
// WindowSurfaceGLX.h: GLX implementation of egl::Surface // WindowSurfaceGLX.h: GLX implementation of egl::Surface for windows
#ifndef LIBANGLE_RENDERER_GL_GLX_WINDOWSURFACEGLX_H_ #ifndef LIBANGLE_RENDERER_GL_GLX_WINDOWSURFACEGLX_H_
#define LIBANGLE_RENDERER_GL_GLX_WINDOWSURFACEGLX_H_ #define LIBANGLE_RENDERER_GL_GLX_WINDOWSURFACEGLX_H_
......
//
// 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.h: NSOpenGL implementation of egl::Display
#ifndef LIBANGLE_RENDERER_GL_NSGL_DISPLAYNSGL_H_
#define LIBANGLE_RENDERER_GL_NSGL_DISPLAYNSGL_H_
#include "libANGLE/renderer/gl/DisplayGL.h"
namespace rx
{
class DisplayNSGL : public DisplayGL
{
public:
DisplayNSGL();
~DisplayNSGL() override;
egl::Error initialize(egl::Display *display) override;
void terminate() override;
SurfaceImpl *createWindowSurface(const egl::Config *configuration,
EGLNativeWindowType window,
const egl::AttributeMap &attribs) override;
SurfaceImpl *createPbufferSurface(const egl::Config *configuration,
const egl::AttributeMap &attribs) override;
SurfaceImpl *createPbufferFromClientBuffer(const egl::Config *configuration,
EGLClientBuffer shareHandle,
const egl::AttributeMap &attribs) override;
SurfaceImpl *createPixmapSurface(const egl::Config *configuration,
NativePixmapType nativePixmap,
const egl::AttributeMap &attribs) override;
egl::ConfigSet generateConfigs() const override;
bool isDeviceLost() const override;
bool testDeviceLost() override;
egl::Error restoreLostDevice() override;
bool isValidNativeWindow(EGLNativeWindowType window) const override;
egl::Error getDevice(DeviceImpl **device) override;
std::string getVendorString() const override;
private:
const FunctionsGL *getFunctionsGL() const override;
void generateExtensions(egl::DisplayExtensions *outExtensions) const override;
void generateCaps(egl::Caps *outCaps) const override;
egl::Display *mEGLDisplay;
};
}
#endif // LIBANGLE_RENDERER_GL_NSGL_DISPLAYNSGL_H_
//
// 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();
}
}
//
// 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.h: NSOpenGL implementation of egl::Surface for windows
#ifndef LIBANGLE_RENDERER_GL_NSGL_WINDOWSURFACENSGL_H_
#define LIBANGLE_RENDERER_GL_NSGL_WINDOWSURFACENSGL_H_
#include "libANGLE/renderer/gl/SurfaceGL.h"
namespace rx
{
class WindowSurfaceNSGL : public SurfaceGL
{
public:
WindowSurfaceNSGL();
~WindowSurfaceNSGL() override;
egl::Error initialize() override;
egl::Error makeCurrent() override;
egl::Error swap() override;
egl::Error postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height) override;
egl::Error querySurfacePointerANGLE(EGLint attribute, void **value) override;
egl::Error bindTexImage(EGLint buffer) override;
egl::Error releaseTexImage(EGLint buffer) override;
void setSwapInterval(EGLint interval) override;
EGLint getWidth() const override;
EGLint getHeight() const override;
EGLint isPostSubBufferSupported() const override;
};
}
#endif // LIBANGLE_RENDERER_GL_NSGL_WINDOWSURFACENSGL_H_
//
// 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;
}
}
...@@ -453,6 +453,13 @@ ...@@ -453,6 +453,13 @@
'libANGLE/renderer/gl/glx/functionsglx_typedefs.h', 'libANGLE/renderer/gl/glx/functionsglx_typedefs.h',
'libANGLE/renderer/gl/glx/platform_glx.h', 'libANGLE/renderer/gl/glx/platform_glx.h',
], ],
'libangle_gl_nsgl_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',
],
'libglesv2_sources': 'libglesv2_sources':
[ [
'common/angleutils.h', 'common/angleutils.h',
...@@ -698,6 +705,13 @@ ...@@ -698,6 +705,13 @@
'<@(libangle_gl_glx_sources)', '<@(libangle_gl_glx_sources)',
], ],
}], }],
['OS=="mac"',
{
'sources':
[
'<@(libangle_gl_nsgl_sources)',
],
}],
], ],
}], }],
['angle_build_winrt==0 and OS=="win"', ['angle_build_winrt==0 and OS=="win"',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment