Commit 9477dc94 by Corentin Wallez

Add GLX EGL implementation stubs

BUG=angleproject:892 Change-Id: I1ef1bd0ce60f4585e473f9750c748a1b41c09da2 Reviewed-on: https://chromium-review.googlesource.com/269741Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Tested-by: 's avatarCorentin Wallez <cwallez@chromium.org>
parent d5008157
......@@ -26,6 +26,10 @@
'angle_enable_d3d11%': 1,
'angle_enable_hlsl%': 1,
}],
['OS=="linux"',
{
'angle_enable_gl%': 1,
}],
],
},
'includes':
......
......@@ -35,6 +35,8 @@
#if defined(ANGLE_ENABLE_OPENGL)
# if defined(ANGLE_PLATFORM_WINDOWS)
# include "libANGLE/renderer/gl/wgl/DisplayWGL.h"
# elif defined(ANGLE_PLATFORM_LINUX)
# include "libANGLE/renderer/gl/glx/DisplayGLX.h"
# else
# error Unsupported OpenGL platform.
# endif
......@@ -107,6 +109,8 @@ rx::DisplayImpl *CreateDisplayImpl(const AttributeMap &attribMap)
#if defined(ANGLE_ENABLE_D3D9) || defined(ANGLE_ENABLE_D3D11)
// Default to D3D displays
impl = new rx::DisplayD3D();
#elif defined(ANGLE_PLATFORM_LINUX)
impl = new rx::DisplayGLX();
#else
// No display available
UNREACHABLE();
......@@ -127,6 +131,8 @@ rx::DisplayImpl *CreateDisplayImpl(const AttributeMap &attribMap)
#if defined(ANGLE_ENABLE_OPENGL)
#if defined(ANGLE_PLATFORM_WINDOWS)
impl = new rx::DisplayWGL();
#elif defined(ANGLE_PLATFORM_LINUX)
impl = new rx::DisplayGLX();
#else
#error Unsupported OpenGL platform.
#endif
......
//
// 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.
//
// DisplayGLX.h: GLX implementation of egl::Display
#include "libANGLE/renderer/gl/glx/DisplayGLX.h"
#include "common/debug.h"
#include "libANGLE/Config.h"
#include "libANGLE/Display.h"
#include "libANGLE/Surface.h"
namespace rx
{
class FunctionsGLX : public FunctionsGL
{
public:
FunctionsGLX()
{
}
virtual ~FunctionsGLX()
{
}
private:
void *loadProcAddress(const std::string &function) override
{
return nullptr;
}
};
DisplayGLX::DisplayGLX()
: DisplayGL(),
mFunctionsGL(nullptr)
{
}
DisplayGLX::~DisplayGLX()
{
}
egl::Error DisplayGLX::initialize(egl::Display *display)
{
mFunctionsGL = new FunctionsGLX;
mFunctionsGL->initialize();
return egl::Error(EGL_SUCCESS);
}
void DisplayGLX::terminate()
{
DisplayGL::terminate();
SafeDelete(mFunctionsGL);
}
SurfaceImpl *DisplayGLX::createWindowSurface(const egl::Config *configuration,
EGLNativeWindowType window,
const egl::AttributeMap &attribs)
{
UNIMPLEMENTED();
return nullptr;
}
SurfaceImpl *DisplayGLX::createPbufferSurface(const egl::Config *configuration,
const egl::AttributeMap &attribs)
{
UNIMPLEMENTED();
return nullptr;
}
SurfaceImpl* DisplayGLX::createPbufferFromClientBuffer(const egl::Config *configuration,
EGLClientBuffer shareHandle,
const egl::AttributeMap &attribs)
{
UNIMPLEMENTED();
return nullptr;
}
SurfaceImpl *DisplayGLX::createPixmapSurface(const egl::Config *configuration,
NativePixmapType nativePixmap,
const egl::AttributeMap &attribs)
{
UNIMPLEMENTED();
return nullptr;
}
egl::Error DisplayGLX::getDevice(DeviceImpl **device)
{
UNIMPLEMENTED();
return egl::Error(EGL_BAD_DISPLAY);
}
egl::ConfigSet DisplayGLX::generateConfigs() const
{
UNIMPLEMENTED();
egl::ConfigSet configs;
return configs;
}
bool DisplayGLX::isDeviceLost() const
{
UNIMPLEMENTED();
return false;
}
bool DisplayGLX::testDeviceLost()
{
UNIMPLEMENTED();
return false;
}
egl::Error DisplayGLX::restoreLostDevice()
{
UNIMPLEMENTED();
return egl::Error(EGL_BAD_DISPLAY);
}
bool DisplayGLX::isValidNativeWindow(EGLNativeWindowType window) const
{
UNIMPLEMENTED();
return true;
}
std::string DisplayGLX::getVendorString() const
{
UNIMPLEMENTED();
return "";
}
const FunctionsGL *DisplayGLX::getFunctionsGL() const
{
UNIMPLEMENTED();
return mFunctionsGL;
}
void DisplayGLX::generateExtensions(egl::DisplayExtensions *outExtensions) const
{
UNIMPLEMENTED();
}
void DisplayGLX::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.
//
// DisplayGLX.h: GLX implementation of egl::Display
#ifndef LIBANGLE_RENDERER_GL_GLX_DISPLAYGLX_H_
#define LIBANGLE_RENDERER_GL_GLX_DISPLAYGLX_H_
#include "libANGLE/renderer/gl/DisplayGL.h"
namespace rx
{
class FunctionsGLX;
class DisplayGLX : public DisplayGL
{
public:
DisplayGLX();
~DisplayGLX() 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;
FunctionsGL *mFunctionsGL;
};
}
#endif // LIBANGLE_RENDERER_GL_GLX_DISPLAYGLX_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.
//
// WindowSurfaceGLX.cpp: GLX implementation of egl::Surface for windows
#include "libANGLE/renderer/gl/glx/WindowSurfaceGLX.h"
#include "common/debug.h"
namespace rx
{
WindowSurfaceGLX::WindowSurfaceGLX()
: SurfaceGL()
{
}
WindowSurfaceGLX::~WindowSurfaceGLX()
{
}
egl::Error WindowSurfaceGLX::initialize()
{
UNIMPLEMENTED();
return egl::Error(EGL_SUCCESS);
}
egl::Error WindowSurfaceGLX::makeCurrent()
{
UNIMPLEMENTED();
return egl::Error(EGL_SUCCESS);
}
egl::Error WindowSurfaceGLX::swap()
{
UNIMPLEMENTED();
return egl::Error(EGL_SUCCESS);
}
egl::Error WindowSurfaceGLX::postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height)
{
UNIMPLEMENTED();
return egl::Error(EGL_SUCCESS);
}
egl::Error WindowSurfaceGLX::querySurfacePointerANGLE(EGLint attribute, void **value)
{
UNIMPLEMENTED();
return egl::Error(EGL_SUCCESS);
}
egl::Error WindowSurfaceGLX::bindTexImage(EGLint buffer)
{
UNIMPLEMENTED();
return egl::Error(EGL_SUCCESS);
}
egl::Error WindowSurfaceGLX::releaseTexImage(EGLint buffer)
{
UNIMPLEMENTED();
return egl::Error(EGL_SUCCESS);
}
void WindowSurfaceGLX::setSwapInterval(EGLint interval)
{
UNIMPLEMENTED();
}
EGLint WindowSurfaceGLX::getWidth() const
{
UNIMPLEMENTED();
return 0;
}
EGLint WindowSurfaceGLX::getHeight() const
{
UNIMPLEMENTED();
return 0;
}
EGLint WindowSurfaceGLX::isPostSubBufferSupported() const
{
UNIMPLEMENTED();
return EGL_FALSE;
}
}
//
// 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.
//
// WindowSurfaceGLX.h: GLX implementation of egl::Surface
#ifndef LIBANGLE_RENDERER_GL_GLX_WINDOWSURFACEGLX_H_
#define LIBANGLE_RENDERER_GL_GLX_WINDOWSURFACEGLX_H_
#include "libANGLE/renderer/gl/SurfaceGL.h"
namespace rx
{
class WindowSurfaceGLX : public SurfaceGL
{
public:
WindowSurfaceGLX();
~WindowSurfaceGLX() override;
egl::Error initialize();
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_GLX_WINDOWSURFACEGLX_H_
......@@ -433,6 +433,13 @@
'libANGLE/renderer/gl/wgl/wgl_utils.h',
'third_party/khronos/GL/wglext.h',
],
'libangle_gl_glx_sources':
[
'libANGLE/renderer/gl/glx/DisplayGLX.cpp',
'libANGLE/renderer/gl/glx/DisplayGLX.h',
'libANGLE/renderer/gl/glx/WindowSurfaceGLX.cpp',
'libANGLE/renderer/gl/glx/WindowSurfaceGLX.h',
],
'libglesv2_sources':
[
'common/angleutils.h',
......@@ -643,6 +650,13 @@
'<@(libangle_gl_wgl_sources)',
],
}],
['OS=="linux"',
{
'sources':
[
'<@(libangle_gl_glx_sources)',
],
}],
],
}],
['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