Commit 1a506957 by Geoff Lang

Rename SurfaceWGL to WindowSurfaceWGL.

BUG=angleproject:890 Change-Id: I72f28583e3903b273578abb6ed487c0a8d696746 Reviewed-on: https://chromium-review.googlesource.com/261359Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Tested-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 1aca922a
......@@ -10,7 +10,9 @@
#include "libANGLE/AttributeMap.h"
#include "libANGLE/Context.h"
#include "libANGLE/Surface.h"
#include "libANGLE/renderer/gl/RendererGL.h"
#include "libANGLE/renderer/gl/SurfaceGL.h"
#include <EGL/eglext.h>
......@@ -49,4 +51,15 @@ egl::Error DisplayGL::createContext(const egl::Config *config, const gl::Context
return egl::Error(EGL_SUCCESS);
}
egl::Error DisplayGL::makeCurrent(egl::Surface *drawSurface, egl::Surface *readSurface, gl::Context *context)
{
if (!drawSurface)
{
return egl::Error(EGL_SUCCESS);
}
SurfaceGL *glDrawSurface = GetImplAs<SurfaceGL>(drawSurface);
return glDrawSurface->makeCurrent();
}
}
......@@ -29,6 +29,8 @@ class DisplayGL : public DisplayImpl
egl::Error createContext(const egl::Config *config, const gl::Context *shareContext, const egl::AttributeMap &attribs,
gl::Context **outContext) override;
egl::Error makeCurrent(egl::Surface *drawSurface, egl::Surface *readSurface, gl::Context *context) override;
private:
virtual const FunctionsGL *getFunctionsGL() const = 0;
......
......@@ -19,6 +19,8 @@ class SurfaceGL : public SurfaceImpl
public:
SurfaceGL();
~SurfaceGL() override;
virtual egl::Error makeCurrent() = 0;
};
}
......
......@@ -13,7 +13,7 @@
#include "libANGLE/Display.h"
#include "libANGLE/Surface.h"
#include "libANGLE/renderer/gl/wgl/FunctionsWGL.h"
#include "libANGLE/renderer/gl/wgl/SurfaceWGL.h"
#include "libANGLE/renderer/gl/wgl/WindowSurfaceWGL.h"
#include "libANGLE/renderer/gl/wgl/wgl_utils.h"
#include <EGL/eglext.h>
......@@ -337,7 +337,7 @@ void DisplayWGL::terminate()
egl::Error DisplayWGL::createWindowSurface(const egl::Config *configuration, EGLNativeWindowType window,
const egl::AttributeMap &attribs, SurfaceImpl **outSurface)
{
SurfaceWGL *surface = new SurfaceWGL(window, mWindowClass, mPixelFormat, mWGLContext, mFunctionsWGL);
WindowSurfaceWGL *surface = new WindowSurfaceWGL(window, mWindowClass, mPixelFormat, mWGLContext, mFunctionsWGL);
egl::Error error = surface->initialize();
if (error.isError())
{
......@@ -370,17 +370,6 @@ egl::Error DisplayWGL::createPixmapSurface(const egl::Config *configuration, Nat
return egl::Error(EGL_BAD_DISPLAY);
}
egl::Error DisplayWGL::makeCurrent(egl::Surface *drawSurface, egl::Surface *readSurface, gl::Context *context)
{
if (!drawSurface)
{
return egl::Error(EGL_SUCCESS);
}
SurfaceWGL *wglDrawSurface = SurfaceWGL::makeSurfaceWGL(drawSurface->getImplementation());
return wglDrawSurface->makeCurrent();
}
egl::ConfigSet DisplayWGL::generateConfigs() const
{
egl::ConfigSet configs;
......
......@@ -36,8 +36,6 @@ class DisplayWGL : public DisplayGL
egl::Error createPixmapSurface(const egl::Config *configuration, NativePixmapType nativePixmap,
const egl::AttributeMap &attribs, SurfaceImpl **outSurface) override;
egl::Error makeCurrent(egl::Surface *drawSurface, egl::Surface *readSurface, gl::Context *context) override;
egl::ConfigSet generateConfigs() const override;
bool isDeviceLost() const override;
......
......@@ -4,9 +4,9 @@
// found in the LICENSE file.
//
// SurfaceWGL.cpp: WGL implementation of egl::Surface
// WindowSurfaceWGL.cpp: WGL implementation of egl::Surface for windows
#include "libANGLE/renderer/gl/wgl/SurfaceWGL.h"
#include "libANGLE/renderer/gl/wgl/WindowSurfaceWGL.h"
#include "common/debug.h"
#include "libANGLE/renderer/gl/wgl/FunctionsWGL.h"
......@@ -15,7 +15,7 @@
namespace rx
{
SurfaceWGL::SurfaceWGL(EGLNativeWindowType window, ATOM windowClass, int pixelFormat, HGLRC wglContext, const FunctionsWGL *functions)
WindowSurfaceWGL::WindowSurfaceWGL(EGLNativeWindowType window, ATOM windowClass, int pixelFormat, HGLRC wglContext, const FunctionsWGL *functions)
: SurfaceGL(),
mWindowClass(windowClass),
mPixelFormat(pixelFormat),
......@@ -27,7 +27,7 @@ SurfaceWGL::SurfaceWGL(EGLNativeWindowType window, ATOM windowClass, int pixelFo
{
}
SurfaceWGL::~SurfaceWGL()
WindowSurfaceWGL::~WindowSurfaceWGL()
{
mWindowClass = 0;
mPixelFormat = 0;
......@@ -41,13 +41,7 @@ SurfaceWGL::~SurfaceWGL()
mChildWindow = nullptr;
}
SurfaceWGL *SurfaceWGL::makeSurfaceWGL(SurfaceImpl *impl)
{
ASSERT(HAS_DYNAMIC_TYPE(SurfaceWGL*, impl));
return static_cast<SurfaceWGL*>(impl);
}
egl::Error SurfaceWGL::initialize()
egl::Error WindowSurfaceWGL::initialize()
{
// Create a child window of the supplied window to draw to.
RECT rect;
......@@ -89,7 +83,7 @@ egl::Error SurfaceWGL::initialize()
return egl::Error(EGL_SUCCESS);
}
egl::Error SurfaceWGL::makeCurrent()
egl::Error WindowSurfaceWGL::makeCurrent()
{
if (!mFunctionsWGL->makeCurrent(mChildDeviceContext, mShareWGLContext))
{
......@@ -100,7 +94,7 @@ egl::Error SurfaceWGL::makeCurrent()
return egl::Error(EGL_SUCCESS);
}
egl::Error SurfaceWGL::swap()
egl::Error WindowSurfaceWGL::swap()
{
// Resize the child window to the interior of the parent window.
RECT rect;
......@@ -125,31 +119,31 @@ egl::Error SurfaceWGL::swap()
return egl::Error(EGL_SUCCESS);
}
egl::Error SurfaceWGL::postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height)
egl::Error WindowSurfaceWGL::postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height)
{
UNIMPLEMENTED();
return egl::Error(EGL_SUCCESS);
}
egl::Error SurfaceWGL::querySurfacePointerANGLE(EGLint attribute, void **value)
egl::Error WindowSurfaceWGL::querySurfacePointerANGLE(EGLint attribute, void **value)
{
UNIMPLEMENTED();
return egl::Error(EGL_SUCCESS);
}
egl::Error SurfaceWGL::bindTexImage(EGLint buffer)
egl::Error WindowSurfaceWGL::bindTexImage(EGLint buffer)
{
UNIMPLEMENTED();
return egl::Error(EGL_SUCCESS);
}
egl::Error SurfaceWGL::releaseTexImage(EGLint buffer)
egl::Error WindowSurfaceWGL::releaseTexImage(EGLint buffer)
{
UNIMPLEMENTED();
return egl::Error(EGL_SUCCESS);
}
void SurfaceWGL::setSwapInterval(EGLint interval)
void WindowSurfaceWGL::setSwapInterval(EGLint interval)
{
if (mFunctionsWGL->swapIntervalEXT)
{
......@@ -157,7 +151,7 @@ void SurfaceWGL::setSwapInterval(EGLint interval)
}
}
EGLint SurfaceWGL::getWidth() const
EGLint WindowSurfaceWGL::getWidth() const
{
RECT rect;
if (!GetClientRect(mParentWindow, &rect))
......@@ -167,7 +161,7 @@ EGLint SurfaceWGL::getWidth() const
return rect.right - rect.left;
}
EGLint SurfaceWGL::getHeight() const
EGLint WindowSurfaceWGL::getHeight() const
{
RECT rect;
if (!GetClientRect(mParentWindow, &rect))
......@@ -177,7 +171,7 @@ EGLint SurfaceWGL::getHeight() const
return rect.bottom - rect.top;
}
EGLint SurfaceWGL::isPostSubBufferSupported() const
EGLint WindowSurfaceWGL::isPostSubBufferSupported() const
{
// PostSubBuffer extension not exposed on WGL.
UNIMPLEMENTED();
......
......@@ -4,10 +4,10 @@
// found in the LICENSE file.
//
// SurfaceWGL.h: WGL implementation of egl::Surface
// WindowSurfaceWGL.h: WGL implementation of egl::Surface for windows
#ifndef LIBANGLE_RENDERER_GL_WGL_SURFACEWGL_H_
#define LIBANGLE_RENDERER_GL_WGL_SURFACEWGL_H_
#ifndef LIBANGLE_RENDERER_GL_WGL_WINDOWSURFACEWGL_H_
#define LIBANGLE_RENDERER_GL_WGL_WINDOWSURFACEWGL_H_
#include "libANGLE/renderer/gl/SurfaceGL.h"
......@@ -18,16 +18,14 @@ namespace rx
class FunctionsWGL;
class SurfaceWGL : public SurfaceGL
class WindowSurfaceWGL : public SurfaceGL
{
public:
SurfaceWGL(EGLNativeWindowType window, ATOM windowClass, int pixelFormat, HGLRC wglContext, const FunctionsWGL *functions);
~SurfaceWGL() override;
static SurfaceWGL *makeSurfaceWGL(SurfaceImpl *impl);
WindowSurfaceWGL(EGLNativeWindowType window, ATOM windowClass, int pixelFormat, HGLRC wglContext, const FunctionsWGL *functions);
~WindowSurfaceWGL() override;
egl::Error initialize();
egl::Error makeCurrent();
egl::Error makeCurrent() override;
egl::Error swap() override;
egl::Error postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height) override;
......@@ -56,4 +54,4 @@ class SurfaceWGL : public SurfaceGL
}
#endif // LIBANGLE_RENDERER_GL_WGL_SURFACEWGL_H_
#endif // LIBANGLE_RENDERER_GL_WGL_WINDOWSURFACEWGL_H_
......@@ -418,8 +418,8 @@
'libANGLE/renderer/gl/wgl/DisplayWGL.h',
'libANGLE/renderer/gl/wgl/FunctionsWGL.cpp',
'libANGLE/renderer/gl/wgl/FunctionsWGL.h',
'libANGLE/renderer/gl/wgl/SurfaceWGL.cpp',
'libANGLE/renderer/gl/wgl/SurfaceWGL.h',
'libANGLE/renderer/gl/wgl/WindowSurfaceWGL.cpp',
'libANGLE/renderer/gl/wgl/WindowSurfaceWGL.h',
'libANGLE/renderer/gl/wgl/functionswgl_typedefs.h',
'libANGLE/renderer/gl/wgl/wgl_utils.cpp',
'libANGLE/renderer/gl/wgl/wgl_utils.h',
......
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