Commit 56a4cc12 by Maksim Sisov Committed by Commit Bot

Rename DisplayOzone to DisplayGbm.

DisplayOzone doesn't really have anything related to Ozone. Instead, it's the gbm platform that is used there. Thus, rename it to DisplayGbm. Bug: chromium:1084458 Change-Id: I4d974f6afbf0daa28fc3e83943b35814dca203fd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2211763Reviewed-by: 's avatarMichael Spang <spang@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
parent 9bb7dd8a
...@@ -686,9 +686,9 @@ angle_source_set("libANGLE_base") { ...@@ -686,9 +686,9 @@ angle_source_set("libANGLE_base") {
} }
if (ozone_platform_gbm) { if (ozone_platform_gbm) {
configs += [ ":libdrm" ] configs += [ ":libdrm" ]
defines += [ "ANGLE_USE_OZONE" ] defines += [ "ANGLE_USE_GBM" ]
deps += [ "//third_party/minigbm" ] deps += [ "//third_party/minigbm" ]
sources += libangle_gl_ozone_sources sources += libangle_gl_gbm_sources
} }
} }
......
...@@ -187,7 +187,7 @@ IGNORED_INCLUDES = { ...@@ -187,7 +187,7 @@ IGNORED_INCLUDES = {
b'libANGLE/renderer/gl/eagl/DisplayEAGL.h', b'libANGLE/renderer/gl/eagl/DisplayEAGL.h',
b'libANGLE/renderer/gl/egl/android/DisplayAndroid.h', b'libANGLE/renderer/gl/egl/android/DisplayAndroid.h',
b'libANGLE/renderer/gl/egl/DisplayEGL.h', b'libANGLE/renderer/gl/egl/DisplayEGL.h',
b'libANGLE/renderer/gl/egl/ozone/DisplayOzone.h', b'libANGLE/renderer/gl/egl/gbm/DisplayGbm.h',
b'libANGLE/renderer/gl/glx/DisplayGLX.h', b'libANGLE/renderer/gl/glx/DisplayGLX.h',
b'libANGLE/renderer/gl/wgl/DisplayWGL.h', b'libANGLE/renderer/gl/wgl/DisplayWGL.h',
b'libANGLE/renderer/metal/DisplayMtl_api.h', b'libANGLE/renderer/metal/DisplayMtl_api.h',
......
...@@ -55,8 +55,8 @@ ...@@ -55,8 +55,8 @@
# elif defined(ANGLE_PLATFORM_IOS) # elif defined(ANGLE_PLATFORM_IOS)
# include "libANGLE/renderer/gl/eagl/DisplayEAGL.h" # include "libANGLE/renderer/gl/eagl/DisplayEAGL.h"
# elif defined(ANGLE_PLATFORM_LINUX) # elif defined(ANGLE_PLATFORM_LINUX)
# if defined(ANGLE_USE_OZONE) # if defined(ANGLE_USE_GBM)
# include "libANGLE/renderer/gl/egl/ozone/DisplayOzone.h" # include "libANGLE/renderer/gl/egl/gbm/DisplayGbm.h"
# else # else
# include "libANGLE/renderer/gl/egl/DisplayEGL.h" # include "libANGLE/renderer/gl/egl/DisplayEGL.h"
# if defined(ANGLE_USE_X11) # if defined(ANGLE_USE_X11)
...@@ -187,7 +187,7 @@ EGLAttrib GetDisplayTypeFromEnvironment() ...@@ -187,7 +187,7 @@ EGLAttrib GetDisplayTypeFromEnvironment()
#elif defined(ANGLE_ENABLE_VULKAN) && defined(ANGLE_PLATFORM_ANDROID) #elif defined(ANGLE_ENABLE_VULKAN) && defined(ANGLE_PLATFORM_ANDROID)
return EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE; return EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE;
#elif defined(ANGLE_ENABLE_OPENGL) #elif defined(ANGLE_ENABLE_OPENGL)
# if defined(ANGLE_PLATFORM_ANDROID) || defined(ANGLE_USE_OZONE) # if defined(ANGLE_PLATFORM_ANDROID) || defined(ANGLE_USE_GBM)
return EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE; return EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE;
# else # else
return EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE; return EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE;
...@@ -285,8 +285,8 @@ rx::DisplayImpl *CreateDisplayFromAttribs(EGLAttrib displayType, ...@@ -285,8 +285,8 @@ rx::DisplayImpl *CreateDisplayFromAttribs(EGLAttrib displayType,
# if defined(ANGLE_PLATFORM_WINDOWS) # if defined(ANGLE_PLATFORM_WINDOWS)
impl = new rx::DisplayWGL(state); impl = new rx::DisplayWGL(state);
# elif defined(ANGLE_PLATFORM_LINUX) # elif defined(ANGLE_PLATFORM_LINUX)
# if defined(ANGLE_USE_OZONE) # if defined(ANGLE_USE_GBM)
impl = new rx::DisplayOzone(state); impl = new rx::DisplayGbm(state);
# else # else
if (deviceType == EGL_PLATFORM_ANGLE_DEVICE_TYPE_EGL_ANGLE) if (deviceType == EGL_PLATFORM_ANGLE_DEVICE_TYPE_EGL_ANGLE)
{ {
...@@ -1420,7 +1420,7 @@ static ClientExtensions GenerateClientExtensions() ...@@ -1420,7 +1420,7 @@ static ClientExtensions GenerateClientExtensions()
extensions.x11Visual = true; extensions.x11Visual = true;
#endif #endif
#if defined(ANGLE_PLATFORM_LINUX) && !defined(ANGLE_USE_OZONE) #if defined(ANGLE_PLATFORM_LINUX) && !defined(ANGLE_USE_GBM)
extensions.platformANGLEDeviceTypeEGLANGLE = true; extensions.platformANGLEDeviceTypeEGLANGLE = true;
#endif #endif
......
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
// found in the LICENSE file. // found in the LICENSE file.
// //
// DisplayOzone.cpp: Ozone implementation of egl::Display // DisplayGbm.cpp: Gbm implementation of egl::Display
#include "libANGLE/renderer/gl/egl/ozone/DisplayOzone.h" #include "libANGLE/renderer/gl/egl/gbm/DisplayGbm.h"
#include <fcntl.h> #include <fcntl.h>
#include <poll.h> #include <poll.h>
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#include "libANGLE/renderer/gl/egl/ContextEGL.h" #include "libANGLE/renderer/gl/egl/ContextEGL.h"
#include "libANGLE/renderer/gl/egl/DisplayEGL.h" #include "libANGLE/renderer/gl/egl/DisplayEGL.h"
#include "libANGLE/renderer/gl/egl/FunctionsEGLDL.h" #include "libANGLE/renderer/gl/egl/FunctionsEGLDL.h"
#include "libANGLE/renderer/gl/egl/ozone/SurfaceOzone.h" #include "libANGLE/renderer/gl/egl/gbm/SurfaceGbm.h"
#include "platform/Platform.h" #include "platform/Platform.h"
// ARM-specific extension needed to make Mali GPU behave - not in any // ARM-specific extension needed to make Mali GPU behave - not in any
...@@ -91,7 +91,7 @@ SwapControlData::SwapControlData() ...@@ -91,7 +91,7 @@ SwapControlData::SwapControlData()
: targetSwapInterval(0), maxSwapInterval(-1), currentSwapInterval(-1) : targetSwapInterval(0), maxSwapInterval(-1), currentSwapInterval(-1)
{} {}
DisplayOzone::Buffer::Buffer(DisplayOzone *display, DisplayGbm::Buffer::Buffer(DisplayGbm *display,
uint32_t useFlags, uint32_t useFlags,
uint32_t gbmFormat, uint32_t gbmFormat,
uint32_t drmFormat, uint32_t drmFormat,
...@@ -118,7 +118,7 @@ DisplayOzone::Buffer::Buffer(DisplayOzone *display, ...@@ -118,7 +118,7 @@ DisplayOzone::Buffer::Buffer(DisplayOzone *display,
mTexture(0) mTexture(0)
{} {}
DisplayOzone::Buffer::~Buffer() DisplayGbm::Buffer::~Buffer()
{ {
reset(); reset();
...@@ -129,7 +129,7 @@ DisplayOzone::Buffer::~Buffer() ...@@ -129,7 +129,7 @@ DisplayOzone::Buffer::~Buffer()
mDSBuffer = 0; mDSBuffer = 0;
} }
void DisplayOzone::Buffer::reset() void DisplayGbm::Buffer::reset()
{ {
if (mHasDRMFB) if (mHasDRMFB)
{ {
...@@ -167,7 +167,7 @@ void DisplayOzone::Buffer::reset() ...@@ -167,7 +167,7 @@ void DisplayOzone::Buffer::reset()
} }
} }
bool DisplayOzone::Buffer::resize(int32_t width, int32_t height) bool DisplayGbm::Buffer::resize(int32_t width, int32_t height)
{ {
if (mWidth == width && mHeight == height) if (mWidth == width && mHeight == height)
{ {
...@@ -231,24 +231,24 @@ bool DisplayOzone::Buffer::resize(int32_t width, int32_t height) ...@@ -231,24 +231,24 @@ bool DisplayOzone::Buffer::resize(int32_t width, int32_t height)
return true; return true;
} }
bool DisplayOzone::Buffer::initialize(const NativeWindow *native) bool DisplayGbm::Buffer::initialize(const NativeWindow *native)
{ {
mNative = native; mNative = native;
return createRenderbuffers() && resize(native->width, native->height); return createRenderbuffers() && resize(native->width, native->height);
} }
bool DisplayOzone::Buffer::initialize(int width, int height) bool DisplayGbm::Buffer::initialize(int width, int height)
{ {
return createRenderbuffers() && resize(width, height); return createRenderbuffers() && resize(width, height);
} }
void DisplayOzone::Buffer::bindTexImage() void DisplayGbm::Buffer::bindTexImage()
{ {
const FunctionsGL *gl = mDisplay->mRenderer->getFunctions(); const FunctionsGL *gl = mDisplay->mRenderer->getFunctions();
gl->eGLImageTargetTexture2DOES(GL_TEXTURE_2D, mImage); gl->eGLImageTargetTexture2DOES(GL_TEXTURE_2D, mImage);
} }
GLuint DisplayOzone::Buffer::getTexture() GLuint DisplayGbm::Buffer::getTexture()
{ {
// TODO(fjhenigman) Try not to create a new texture every time. That already works on Intel // TODO(fjhenigman) Try not to create a new texture every time. That already works on Intel
// and should work on Mali with proper fences. // and should work on Mali with proper fences.
...@@ -266,7 +266,7 @@ GLuint DisplayOzone::Buffer::getTexture() ...@@ -266,7 +266,7 @@ GLuint DisplayOzone::Buffer::getTexture()
return mTexture; return mTexture;
} }
uint32_t DisplayOzone::Buffer::getDRMFB() uint32_t DisplayGbm::Buffer::getDRMFB()
{ {
if (!mHasDRMFB) if (!mHasDRMFB)
{ {
...@@ -287,7 +287,7 @@ uint32_t DisplayOzone::Buffer::getDRMFB() ...@@ -287,7 +287,7 @@ uint32_t DisplayOzone::Buffer::getDRMFB()
return mDRMFB; return mDRMFB;
} }
GLuint DisplayOzone::Buffer::createGLFB(const gl::Context *context) GLuint DisplayGbm::Buffer::createGLFB(const gl::Context *context)
{ {
const FunctionsGL *functions = GetFunctionsGL(context); const FunctionsGL *functions = GetFunctionsGL(context);
StateManagerGL *stateManager = GetStateManagerGL(context); StateManagerGL *stateManager = GetStateManagerGL(context);
...@@ -314,13 +314,13 @@ GLuint DisplayOzone::Buffer::createGLFB(const gl::Context *context) ...@@ -314,13 +314,13 @@ GLuint DisplayOzone::Buffer::createGLFB(const gl::Context *context)
return framebuffer; return framebuffer;
} }
FramebufferGL *DisplayOzone::Buffer::framebufferGL(const gl::Context *context, FramebufferGL *DisplayGbm::Buffer::framebufferGL(const gl::Context *context,
const gl::FramebufferState &state) const gl::FramebufferState &state)
{ {
return new FramebufferGL(state, createGLFB(context), true, false); return new FramebufferGL(state, createGLFB(context), true, false);
} }
void DisplayOzone::Buffer::present(const gl::Context *context) void DisplayGbm::Buffer::present(const gl::Context *context)
{ {
if (mNative) if (mNative)
{ {
...@@ -332,7 +332,7 @@ void DisplayOzone::Buffer::present(const gl::Context *context) ...@@ -332,7 +332,7 @@ void DisplayOzone::Buffer::present(const gl::Context *context)
} }
} }
bool DisplayOzone::Buffer::createRenderbuffers() bool DisplayGbm::Buffer::createRenderbuffers()
{ {
const FunctionsGL *gl = mDisplay->mRenderer->getFunctions(); const FunctionsGL *gl = mDisplay->mRenderer->getFunctions();
StateManagerGL *sm = mDisplay->mRenderer->getStateManager(); StateManagerGL *sm = mDisplay->mRenderer->getStateManager();
...@@ -349,7 +349,7 @@ bool DisplayOzone::Buffer::createRenderbuffers() ...@@ -349,7 +349,7 @@ bool DisplayOzone::Buffer::createRenderbuffers()
return true; return true;
} }
DisplayOzone::DisplayOzone(const egl::DisplayState &state) DisplayGbm::DisplayGbm(const egl::DisplayState &state)
: DisplayEGL(state), : DisplayEGL(state),
mGBM(nullptr), mGBM(nullptr),
mConnector(nullptr), mConnector(nullptr),
...@@ -373,9 +373,9 @@ DisplayOzone::DisplayOzone(const egl::DisplayState &state) ...@@ -373,9 +373,9 @@ DisplayOzone::DisplayOzone(const egl::DisplayState &state)
mDepthUniform(0) mDepthUniform(0)
{} {}
DisplayOzone::~DisplayOzone() {} DisplayGbm::~DisplayGbm() {}
bool DisplayOzone::hasUsableScreen(int fd) bool DisplayGbm::hasUsableScreen(int fd)
{ {
drmModeResPtr resources = drmModeGetResources(fd); drmModeResPtr resources = drmModeGetResources(fd);
if (!resources) if (!resources)
...@@ -429,7 +429,7 @@ bool DisplayOzone::hasUsableScreen(int fd) ...@@ -429,7 +429,7 @@ bool DisplayOzone::hasUsableScreen(int fd)
return false; return false;
} }
egl::Error DisplayOzone::initialize(egl::Display *display) egl::Error DisplayGbm::initialize(egl::Display *display)
{ {
int fd; int fd;
char deviceName[30]; char deviceName[30];
...@@ -545,18 +545,18 @@ egl::Error DisplayOzone::initialize(egl::Display *display) ...@@ -545,18 +545,18 @@ egl::Error DisplayOzone::initialize(egl::Display *display)
return DisplayGL::initialize(display); return DisplayGL::initialize(display);
} }
void DisplayOzone::pageFlipHandler(int fd, void DisplayGbm::pageFlipHandler(int fd,
unsigned int sequence, unsigned int sequence,
unsigned int tv_sec, unsigned int tv_sec,
unsigned int tv_usec, unsigned int tv_usec,
void *data) void *data)
{ {
DisplayOzone *display = reinterpret_cast<DisplayOzone *>(data); DisplayGbm *display = reinterpret_cast<DisplayGbm *>(data);
uint64_t tv = tv_sec; uint64_t tv = tv_sec;
display->pageFlipHandler(sequence, tv * 1000000 + tv_usec); display->pageFlipHandler(sequence, tv * 1000000 + tv_usec);
} }
void DisplayOzone::pageFlipHandler(unsigned int sequence, uint64_t tv) void DisplayGbm::pageFlipHandler(unsigned int sequence, uint64_t tv)
{ {
ASSERT(mPending); ASSERT(mPending);
mUnused = mScanning; mUnused = mScanning;
...@@ -564,7 +564,7 @@ void DisplayOzone::pageFlipHandler(unsigned int sequence, uint64_t tv) ...@@ -564,7 +564,7 @@ void DisplayOzone::pageFlipHandler(unsigned int sequence, uint64_t tv)
mPending = nullptr; mPending = nullptr;
} }
void DisplayOzone::presentScreen() void DisplayGbm::presentScreen()
{ {
if (!mCRTC) if (!mCRTC)
{ {
...@@ -615,7 +615,7 @@ void DisplayOzone::presentScreen() ...@@ -615,7 +615,7 @@ void DisplayOzone::presentScreen()
} }
} }
GLuint DisplayOzone::makeShader(GLuint type, const char *src) GLuint DisplayGbm::makeShader(GLuint type, const char *src)
{ {
const FunctionsGL *gl = mRenderer->getFunctions(); const FunctionsGL *gl = mRenderer->getFunctions();
GLuint shader = gl->createShader(type); GLuint shader = gl->createShader(type);
...@@ -629,13 +629,13 @@ GLuint DisplayOzone::makeShader(GLuint type, const char *src) ...@@ -629,13 +629,13 @@ GLuint DisplayOzone::makeShader(GLuint type, const char *src)
gl->getShaderiv(shader, GL_COMPILE_STATUS, &compiled); gl->getShaderiv(shader, GL_COMPILE_STATUS, &compiled);
if (compiled != GL_TRUE) if (compiled != GL_TRUE)
{ {
WARN() << "DisplayOzone shader compilation error: " << buf; WARN() << "DisplayGbm shader compilation error: " << buf;
} }
return shader; return shader;
} }
void DisplayOzone::drawWithTexture(const gl::Context *context, Buffer *buffer) void DisplayGbm::drawWithTexture(const gl::Context *context, Buffer *buffer)
{ {
const FunctionsGL *gl = mRenderer->getFunctions(); const FunctionsGL *gl = mRenderer->getFunctions();
StateManagerGL *sm = mRenderer->getStateManager(); StateManagerGL *sm = mRenderer->getStateManager();
...@@ -767,7 +767,7 @@ void DisplayOzone::drawWithTexture(const gl::Context *context, Buffer *buffer) ...@@ -767,7 +767,7 @@ void DisplayOzone::drawWithTexture(const gl::Context *context, Buffer *buffer)
sm->deleteFramebuffer(fbo); sm->deleteFramebuffer(fbo);
} }
void DisplayOzone::drawBuffer(const gl::Context *context, Buffer *buffer) void DisplayGbm::drawBuffer(const gl::Context *context, Buffer *buffer)
{ {
if (!mDrawing) if (!mDrawing)
{ {
...@@ -806,7 +806,7 @@ void DisplayOzone::drawBuffer(const gl::Context *context, Buffer *buffer) ...@@ -806,7 +806,7 @@ void DisplayOzone::drawBuffer(const gl::Context *context, Buffer *buffer)
presentScreen(); presentScreen();
} }
void DisplayOzone::flushGL() void DisplayGbm::flushGL()
{ {
const FunctionsGL *gl = mRenderer->getFunctions(); const FunctionsGL *gl = mRenderer->getFunctions();
gl->flush(); gl->flush();
...@@ -836,7 +836,7 @@ void DisplayOzone::flushGL() ...@@ -836,7 +836,7 @@ void DisplayOzone::flushGL()
} }
} }
void DisplayOzone::terminate() void DisplayGbm::terminate()
{ {
SafeDelete(mScanning); SafeDelete(mScanning);
SafeDelete(mPending); SafeDelete(mPending);
...@@ -883,7 +883,7 @@ void DisplayOzone::terminate() ...@@ -883,7 +883,7 @@ void DisplayOzone::terminate()
} }
} }
SurfaceImpl *DisplayOzone::createWindowSurface(const egl::SurfaceState &state, SurfaceImpl *DisplayGbm::createWindowSurface(const egl::SurfaceState &state,
EGLNativeWindowType window, EGLNativeWindowType window,
const egl::AttributeMap &attribs) const egl::AttributeMap &attribs)
{ {
...@@ -893,10 +893,10 @@ SurfaceImpl *DisplayOzone::createWindowSurface(const egl::SurfaceState &state, ...@@ -893,10 +893,10 @@ SurfaceImpl *DisplayOzone::createWindowSurface(const egl::SurfaceState &state,
{ {
return nullptr; return nullptr;
} }
return new SurfaceOzone(state, buffer); return new SurfaceGbm(state, buffer);
} }
SurfaceImpl *DisplayOzone::createPbufferSurface(const egl::SurfaceState &state, SurfaceImpl *DisplayGbm::createPbufferSurface(const egl::SurfaceState &state,
const egl::AttributeMap &attribs) const egl::AttributeMap &attribs)
{ {
EGLAttrib width = attribs.get(EGL_WIDTH, 0); EGLAttrib width = attribs.get(EGL_WIDTH, 0);
...@@ -907,27 +907,27 @@ SurfaceImpl *DisplayOzone::createPbufferSurface(const egl::SurfaceState &state, ...@@ -907,27 +907,27 @@ SurfaceImpl *DisplayOzone::createPbufferSurface(const egl::SurfaceState &state,
{ {
return nullptr; return nullptr;
} }
return new SurfaceOzone(state, buffer); return new SurfaceGbm(state, buffer);
} }
ContextImpl *DisplayOzone::createContext(const gl::State &state, ContextImpl *DisplayGbm::createContext(const gl::State &state,
gl::ErrorSet *errorSet, gl::ErrorSet *errorSet,
const egl::Config *configuration, const egl::Config *configuration,
const gl::Context *shareContext, const gl::Context *shareContext,
const egl::AttributeMap &attribs) const egl::AttributeMap &attribs)
{ {
// All contexts on Ozone are virtualized and share the same renderer. // All contexts on Gbm are virtualized and share the same renderer.
return new ContextEGL(state, errorSet, mRenderer); return new ContextEGL(state, errorSet, mRenderer);
} }
egl::Error DisplayOzone::makeCurrent(egl::Surface *drawSurface, egl::Error DisplayGbm::makeCurrent(egl::Surface *drawSurface,
egl::Surface *readSurface, egl::Surface *readSurface,
gl::Context *context) gl::Context *context)
{ {
return DisplayGL::makeCurrent(drawSurface, readSurface, context); return DisplayGL::makeCurrent(drawSurface, readSurface, context);
} }
egl::ConfigSet DisplayOzone::generateConfigs() egl::ConfigSet DisplayGbm::generateConfigs()
{ {
egl::ConfigSet configs; egl::ConfigSet configs;
...@@ -949,17 +949,17 @@ egl::ConfigSet DisplayOzone::generateConfigs() ...@@ -949,17 +949,17 @@ egl::ConfigSet DisplayOzone::generateConfigs()
return configs; return configs;
} }
bool DisplayOzone::isValidNativeWindow(EGLNativeWindowType window) const bool DisplayGbm::isValidNativeWindow(EGLNativeWindowType window) const
{ {
return true; return true;
} }
void DisplayOzone::setSwapInterval(EGLSurface drawable, SwapControlData *data) void DisplayGbm::setSwapInterval(EGLSurface drawable, SwapControlData *data)
{ {
ASSERT(data != nullptr); ASSERT(data != nullptr);
} }
void DisplayOzone::generateExtensions(egl::DisplayExtensions *outExtensions) const void DisplayGbm::generateExtensions(egl::DisplayExtensions *outExtensions) const
{ {
DisplayEGL::generateExtensions(outExtensions); DisplayEGL::generateExtensions(outExtensions);
...@@ -967,11 +967,11 @@ void DisplayOzone::generateExtensions(egl::DisplayExtensions *outExtensions) con ...@@ -967,11 +967,11 @@ void DisplayOzone::generateExtensions(egl::DisplayExtensions *outExtensions) con
outExtensions->surfacelessContext = true; outExtensions->surfacelessContext = true;
} }
class WorkerContextOzone final : public WorkerContext class WorkerContextGbm final : public WorkerContext
{ {
public: public:
WorkerContextOzone(EGLContext context, FunctionsEGL *functions); WorkerContextGbm(EGLContext context, FunctionsEGL *functions);
~WorkerContextOzone() override; ~WorkerContextGbm() override;
bool makeCurrent() override; bool makeCurrent() override;
void unmakeCurrent() override; void unmakeCurrent() override;
...@@ -981,16 +981,16 @@ class WorkerContextOzone final : public WorkerContext ...@@ -981,16 +981,16 @@ class WorkerContextOzone final : public WorkerContext
FunctionsEGL *mFunctions; FunctionsEGL *mFunctions;
}; };
WorkerContextOzone::WorkerContextOzone(EGLContext context, FunctionsEGL *functions) WorkerContextGbm::WorkerContextGbm(EGLContext context, FunctionsEGL *functions)
: mContext(context), mFunctions(functions) : mContext(context), mFunctions(functions)
{} {}
WorkerContextOzone::~WorkerContextOzone() WorkerContextGbm::~WorkerContextGbm()
{ {
mFunctions->destroyContext(mContext); mFunctions->destroyContext(mContext);
} }
bool WorkerContextOzone::makeCurrent() bool WorkerContextGbm::makeCurrent()
{ {
if (mFunctions->makeCurrent(EGL_NO_SURFACE, mContext) == EGL_FALSE) if (mFunctions->makeCurrent(EGL_NO_SURFACE, mContext) == EGL_FALSE)
{ {
...@@ -1000,12 +1000,12 @@ bool WorkerContextOzone::makeCurrent() ...@@ -1000,12 +1000,12 @@ bool WorkerContextOzone::makeCurrent()
return true; return true;
} }
void WorkerContextOzone::unmakeCurrent() void WorkerContextGbm::unmakeCurrent()
{ {
mFunctions->makeCurrent(EGL_NO_SURFACE, EGL_NO_CONTEXT); mFunctions->makeCurrent(EGL_NO_SURFACE, EGL_NO_CONTEXT);
} }
WorkerContext *DisplayOzone::createWorkerContext(std::string *infoLog, WorkerContext *DisplayGbm::createWorkerContext(std::string *infoLog,
EGLContext sharedContext, EGLContext sharedContext,
const native_egl::AttributeVector workerAttribs) const native_egl::AttributeVector workerAttribs)
{ {
...@@ -1015,7 +1015,7 @@ WorkerContext *DisplayOzone::createWorkerContext(std::string *infoLog, ...@@ -1015,7 +1015,7 @@ WorkerContext *DisplayOzone::createWorkerContext(std::string *infoLog,
*infoLog += "Unable to create the EGL context."; *infoLog += "Unable to create the EGL context.";
return nullptr; return nullptr;
} }
return new WorkerContextOzone(context, mEGL); return new WorkerContextGbm(context, mEGL);
} }
} // namespace rx } // namespace rx
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
// found in the LICENSE file. // found in the LICENSE file.
// //
// DisplayOzone.h: Ozone implementation of egl::Display // DisplayGbm.h: Gbm implementation of egl::Display
#ifndef LIBANGLE_RENDERER_GL_EGL_OZONE_DISPLAYOZONE_H_ #ifndef LIBANGLE_RENDERER_GL_EGL_GBM_DISPLAYGBM_H_
#define LIBANGLE_RENDERER_GL_EGL_OZONE_DISPLAYOZONE_H_ #define LIBANGLE_RENDERER_GL_EGL_GBM_DISPLAYGBM_H_
#include <xf86drm.h> #include <xf86drm.h>
#include <xf86drmMode.h> #include <xf86drmMode.h>
...@@ -31,7 +31,7 @@ class FramebufferGL; ...@@ -31,7 +31,7 @@ class FramebufferGL;
class RendererEGL; class RendererEGL;
// TODO(fjhenigman) Implement swap control. The following struct will be used for that. // TODO(fjhenigman) Implement swap control. The following struct will be used for that.
// State-tracking data for the swap control to allow DisplayOzone to remember per // State-tracking data for the swap control to allow DisplayGbm to remember per
// drawable information for swap control. // drawable information for swap control.
struct SwapControlData final struct SwapControlData final
{ {
...@@ -40,12 +40,12 @@ struct SwapControlData final ...@@ -40,12 +40,12 @@ struct SwapControlData final
// Set by the drawable // Set by the drawable
int targetSwapInterval; int targetSwapInterval;
// DisplayOzone-side state-tracking // DisplayGbm-side state-tracking
int maxSwapInterval; int maxSwapInterval;
int currentSwapInterval; int currentSwapInterval;
}; };
class DisplayOzone final : public DisplayEGL class DisplayGbm final : public DisplayEGL
{ {
public: public:
struct NativeWindow struct NativeWindow
...@@ -63,7 +63,7 @@ class DisplayOzone final : public DisplayEGL ...@@ -63,7 +63,7 @@ class DisplayOzone final : public DisplayEGL
class Buffer final : angle::NonCopyable class Buffer final : angle::NonCopyable
{ {
public: public:
Buffer(DisplayOzone *display, Buffer(DisplayGbm *display,
uint32_t useFlags, uint32_t useFlags,
uint32_t gbmFormat, uint32_t gbmFormat,
uint32_t drmFormat, uint32_t drmFormat,
...@@ -89,7 +89,7 @@ class DisplayOzone final : public DisplayEGL ...@@ -89,7 +89,7 @@ class DisplayOzone final : public DisplayEGL
private: private:
bool createRenderbuffers(); bool createRenderbuffers();
DisplayOzone *mDisplay; DisplayGbm *mDisplay;
const NativeWindow *mNative; const NativeWindow *mNative;
int mWidth; int mWidth;
int mHeight; int mHeight;
...@@ -109,8 +109,8 @@ class DisplayOzone final : public DisplayEGL ...@@ -109,8 +109,8 @@ class DisplayOzone final : public DisplayEGL
GLuint mTexture; GLuint mTexture;
}; };
DisplayOzone(const egl::DisplayState &state); DisplayGbm(const egl::DisplayState &state);
~DisplayOzone() override; ~DisplayGbm() override;
egl::Error initialize(egl::Display *display) override; egl::Error initialize(egl::Display *display) override;
void terminate() override; void terminate() override;
...@@ -190,4 +190,4 @@ class DisplayOzone final : public DisplayEGL ...@@ -190,4 +190,4 @@ class DisplayOzone final : public DisplayEGL
}; };
} // namespace rx } // namespace rx
#endif // LIBANGLE_RENDERER_GL_EGL_OZONE_DISPLAYOZONE_H_ #endif // LIBANGLE_RENDERER_GL_EGL_GBM_DISPLAYGBM_H_
...@@ -4,48 +4,48 @@ ...@@ -4,48 +4,48 @@
// found in the LICENSE file. // found in the LICENSE file.
// //
// SurfaceOzone.cpp: Ozone implementation of egl::SurfaceGL // SurfaceGbm.cpp: Gbm implementation of egl::SurfaceGL
#include "libANGLE/renderer/gl/egl/ozone/SurfaceOzone.h" #include "libANGLE/renderer/gl/egl/gbm/SurfaceGbm.h"
#include "libANGLE/renderer/gl/FramebufferGL.h" #include "libANGLE/renderer/gl/FramebufferGL.h"
#include "libANGLE/renderer/gl/egl/ozone/DisplayOzone.h" #include "libANGLE/renderer/gl/egl/gbm/DisplayGbm.h"
namespace rx namespace rx
{ {
SurfaceOzone::SurfaceOzone(const egl::SurfaceState &state, DisplayOzone::Buffer *buffer) SurfaceGbm::SurfaceGbm(const egl::SurfaceState &state, DisplayGbm::Buffer *buffer)
: SurfaceGL(state), mBuffer(buffer) : SurfaceGL(state), mBuffer(buffer)
{} {}
SurfaceOzone::~SurfaceOzone() SurfaceGbm::~SurfaceGbm()
{ {
delete mBuffer; delete mBuffer;
} }
egl::Error SurfaceOzone::initialize(const egl::Display *display) egl::Error SurfaceGbm::initialize(const egl::Display *display)
{ {
return egl::NoError(); return egl::NoError();
} }
FramebufferImpl *SurfaceOzone::createDefaultFramebuffer(const gl::Context *context, FramebufferImpl *SurfaceGbm::createDefaultFramebuffer(const gl::Context *context,
const gl::FramebufferState &state) const gl::FramebufferState &state)
{ {
return mBuffer->framebufferGL(context, state); return mBuffer->framebufferGL(context, state);
} }
egl::Error SurfaceOzone::makeCurrent(const gl::Context *context) egl::Error SurfaceGbm::makeCurrent(const gl::Context *context)
{ {
return egl::NoError(); return egl::NoError();
} }
egl::Error SurfaceOzone::swap(const gl::Context *context) egl::Error SurfaceGbm::swap(const gl::Context *context)
{ {
mBuffer->present(context); mBuffer->present(context);
return egl::NoError(); return egl::NoError();
} }
egl::Error SurfaceOzone::postSubBuffer(const gl::Context *context, egl::Error SurfaceGbm::postSubBuffer(const gl::Context *context,
EGLint x, EGLint x,
EGLint y, EGLint y,
EGLint width, EGLint width,
...@@ -55,47 +55,45 @@ egl::Error SurfaceOzone::postSubBuffer(const gl::Context *context, ...@@ -55,47 +55,45 @@ egl::Error SurfaceOzone::postSubBuffer(const gl::Context *context,
return egl::NoError(); return egl::NoError();
} }
egl::Error SurfaceOzone::querySurfacePointerANGLE(EGLint attribute, void **value) egl::Error SurfaceGbm::querySurfacePointerANGLE(EGLint attribute, void **value)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED();
return egl::NoError(); return egl::NoError();
} }
egl::Error SurfaceOzone::bindTexImage(const gl::Context *context, egl::Error SurfaceGbm::bindTexImage(const gl::Context *context, gl::Texture *texture, EGLint buffer)
gl::Texture *texture,
EGLint buffer)
{ {
mBuffer->bindTexImage(); mBuffer->bindTexImage();
return egl::NoError(); return egl::NoError();
} }
egl::Error SurfaceOzone::releaseTexImage(const gl::Context *context, EGLint buffer) egl::Error SurfaceGbm::releaseTexImage(const gl::Context *context, EGLint buffer)
{ {
return egl::NoError(); return egl::NoError();
} }
void SurfaceOzone::setSwapInterval(EGLint interval) void SurfaceGbm::setSwapInterval(EGLint interval)
{ {
mSwapControl.targetSwapInterval = interval; mSwapControl.targetSwapInterval = interval;
} }
EGLint SurfaceOzone::getWidth() const EGLint SurfaceGbm::getWidth() const
{ {
return mBuffer->getWidth(); return mBuffer->getWidth();
} }
EGLint SurfaceOzone::getHeight() const EGLint SurfaceGbm::getHeight() const
{ {
return mBuffer->getHeight(); return mBuffer->getHeight();
} }
EGLint SurfaceOzone::isPostSubBufferSupported() const EGLint SurfaceGbm::isPostSubBufferSupported() const
{ {
UNIMPLEMENTED(); UNIMPLEMENTED();
return EGL_FALSE; return EGL_FALSE;
} }
EGLint SurfaceOzone::getSwapBehavior() const EGLint SurfaceGbm::getSwapBehavior() const
{ {
return EGL_BUFFER_PRESERVED; return EGL_BUFFER_PRESERVED;
} }
......
...@@ -4,22 +4,22 @@ ...@@ -4,22 +4,22 @@
// found in the LICENSE file. // found in the LICENSE file.
// //
// SurfaceOzone.h: Ozone implementation of egl::SurfaceGL // SurfaceGbm.h: Gbm implementation of egl::SurfaceGL
#ifndef LIBANGLE_RENDERER_GL_EGL_OZONE_SURFACEOZONE_H_ #ifndef LIBANGLE_RENDERER_GL_EGL_GBM_SURFACEGBM_H_
#define LIBANGLE_RENDERER_GL_EGL_OZONE_SURFACEOZONE_H_ #define LIBANGLE_RENDERER_GL_EGL_GBM_SURFACEGBM_H_
#include "libANGLE/renderer/gl/SurfaceGL.h" #include "libANGLE/renderer/gl/SurfaceGL.h"
#include "libANGLE/renderer/gl/egl/ozone/DisplayOzone.h" #include "libANGLE/renderer/gl/egl/gbm/DisplayGbm.h"
namespace rx namespace rx
{ {
class SurfaceOzone : public SurfaceGL class SurfaceGbm : public SurfaceGL
{ {
public: public:
SurfaceOzone(const egl::SurfaceState &state, DisplayOzone::Buffer *buffer); SurfaceGbm(const egl::SurfaceState &state, DisplayGbm::Buffer *buffer);
~SurfaceOzone() override; ~SurfaceGbm() override;
FramebufferImpl *createDefaultFramebuffer(const gl::Context *context, FramebufferImpl *createDefaultFramebuffer(const gl::Context *context,
const gl::FramebufferState &state) override; const gl::FramebufferState &state) override;
...@@ -47,11 +47,11 @@ class SurfaceOzone : public SurfaceGL ...@@ -47,11 +47,11 @@ class SurfaceOzone : public SurfaceGL
EGLint getSwapBehavior() const override; EGLint getSwapBehavior() const override;
private: private:
DisplayOzone::Buffer *mBuffer; DisplayGbm::Buffer *mBuffer;
// TODO(fjhenigman) Implement swap control. This will be used for that. // TODO(fjhenigman) Implement swap control. This will be used for that.
SwapControlData mSwapControl; SwapControlData mSwapControl;
}; };
} // namespace rx } // namespace rx
#endif // LIBANGLE_RENDERER_GL_EGL_OZONE_SURFACEOZONE_H_ #endif // LIBANGLE_RENDERER_GL_EGL_GBM_SURFACEGBM_H_
...@@ -846,11 +846,11 @@ libangle_gl_egl_dl_sources = [ ...@@ -846,11 +846,11 @@ libangle_gl_egl_dl_sources = [
"src/libANGLE/renderer/gl/egl/FunctionsEGLDL.h", "src/libANGLE/renderer/gl/egl/FunctionsEGLDL.h",
] ]
libangle_gl_ozone_sources = [ libangle_gl_gbm_sources = [
"src/libANGLE/renderer/gl/egl/ozone/DisplayOzone.cpp", "src/libANGLE/renderer/gl/egl/gbm/DisplayGbm.cpp",
"src/libANGLE/renderer/gl/egl/ozone/DisplayOzone.h", "src/libANGLE/renderer/gl/egl/gbm/DisplayGbm.h",
"src/libANGLE/renderer/gl/egl/ozone/SurfaceOzone.cpp", "src/libANGLE/renderer/gl/egl/gbm/SurfaceGbm.cpp",
"src/libANGLE/renderer/gl/egl/ozone/SurfaceOzone.h", "src/libANGLE/renderer/gl/egl/gbm/SurfaceGbm.h",
] ]
libangle_gl_egl_android_sources = [ libangle_gl_egl_android_sources = [
......
...@@ -68,7 +68,7 @@ ANGLEPlatform::ANGLEPlatform(angle::LogErrorFunc logErrorFunc) ...@@ -68,7 +68,7 @@ ANGLEPlatform::ANGLEPlatform(angle::LogErrorFunc logErrorFunc)
} }
#endif // (DE_OS == DE_OS_WIN32) #endif // (DE_OS == DE_OS_WIN32)
#if defined(ANGLE_USE_OZONE) || (DE_OS == DE_OS_ANDROID) || (DE_OS == DE_OS_WIN32) #if defined(ANGLE_USE_GBM) || (DE_OS == DE_OS_ANDROID) || (DE_OS == DE_OS_WIN32)
{ {
std::vector<eglw::EGLAttrib> glesAttribs = std::vector<eglw::EGLAttrib> glesAttribs =
initAttribs(EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE); initAttribs(EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE);
......
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