Commit 31c07a30 by Nicolas Capens

Make the EGL surface class abstract.

gl::Surface is now the pure abstract interface for egl::Surface, which can be used by libGLESv2 without requiring typeinfo. Bug chromium:732667 Bug swiftshader:31 Change-Id: I7d8a5892c5b6186541f84c3cf39e72ac1d6c613d Reviewed-on: https://swiftshader-review.googlesource.com/10129Tested-by: 's avatarNicolas Capens <capn@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com>
parent 88f5ec6b
...@@ -12,10 +12,6 @@ ...@@ -12,10 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// Surface.cpp: Implements the egl::Surface class, representing a drawing surface
// such as the client area of a window, including any back buffers.
// Implements EGLSurface and related functionality. [EGL 1.4] section 2.2 page 3.
#include "FrameBufferX11.hpp" #include "FrameBufferX11.hpp"
#include "libX11.hpp" #include "libX11.hpp"
......
...@@ -12,10 +12,6 @@ ...@@ -12,10 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// Surface.cpp: Implements the egl::Surface class, representing a drawing surface
// such as the client area of a window, including any back buffers.
// Implements EGLSurface and related functionality. [EGL 1.4] section 2.2 page 3.
#ifndef sw_FrameBufferX11_hpp #ifndef sw_FrameBufferX11_hpp
#define sw_FrameBufferX11_hpp #define sw_FrameBufferX11_hpp
......
// Copyright 2016 The SwiftShader Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Surface.hpp: Defines the gl::Surface class, which is the abstract interface
// for an EGL surface as viewed by the GL implementation.
#ifndef INCLUDE_SURFACE_H_
#define INCLUDE_SURFACE_H_
#include "Renderer/Surface.hpp"
#include <EGL/egl.h>
namespace egl
{
class Texture;
class Image;
}
namespace gl
{
class [[clang::lto_visibility_public]] Surface
{
protected:
Surface();
virtual ~Surface() = 0;
public:
virtual egl::Image *getRenderTarget() = 0;
virtual egl::Image *getDepthStencil() = 0;
virtual sw::Format getInternalFormat() const = 0;
virtual EGLint getWidth() const = 0;
virtual EGLint getHeight() const = 0;
virtual void setBoundTexture(egl::Texture *texture) = 0;
};
}
#endif // INCLUDE_SURFACE_H_
...@@ -19,7 +19,7 @@ endif ...@@ -19,7 +19,7 @@ endif
COMMON_SRC_FILES := \ COMMON_SRC_FILES := \
Config.cpp \ Config.cpp \
Display.cpp \ Display.cpp \
EGLSurface.cpp \ Surface.cpp \
libEGL.cpp \ libEGL.cpp \
main.cpp main.cpp
......
...@@ -56,7 +56,7 @@ shared_library("swiftshader_libEGL") { ...@@ -56,7 +56,7 @@ shared_library("swiftshader_libEGL") {
"../common/Object.cpp", "../common/Object.cpp",
"Config.cpp", "Config.cpp",
"Display.cpp", "Display.cpp",
"EGLSurface.cpp", "Surface.cpp",
"libEGL.cpp", "libEGL.cpp",
"libEGL.def", "libEGL.def",
"libEGL.rc", "libEGL.rc",
......
...@@ -20,19 +20,18 @@ ...@@ -20,19 +20,18 @@
#include <EGL/egl.h> #include <EGL/egl.h>
#include <GLES/gl.h> #include <GLES/gl.h>
namespace gl { class Surface; }
namespace egl namespace egl
{ {
class Display; class Display;
class Surface;
class Image; class Image;
class [[clang::lto_visibility_public]] Context : public gl::Object class [[clang::lto_visibility_public]] Context : public gl::Object
{ {
public: public:
Context(egl::Display *display) : display(display) {} virtual void makeCurrent(gl::Surface *surface) = 0;
virtual void bindTexImage(gl::Surface *surface) = 0;
virtual void makeCurrent(Surface *surface) = 0;
virtual void bindTexImage(Surface *surface) = 0;
virtual EGLenum validateSharedImage(EGLenum target, GLuint name, GLuint textureLevel) = 0; virtual EGLenum validateSharedImage(EGLenum target, GLuint name, GLuint textureLevel) = 0;
virtual Image *createSharedImage(EGLenum target, GLuint name, GLuint textureLevel) = 0; virtual Image *createSharedImage(EGLenum target, GLuint name, GLuint textureLevel) = 0;
virtual EGLint getClientVersion() const = 0; virtual EGLint getClientVersion() const = 0;
...@@ -40,6 +39,7 @@ public: ...@@ -40,6 +39,7 @@ public:
virtual void finish() = 0; virtual void finish() = 0;
protected: protected:
Context(egl::Display *display) : display(display) {}
virtual ~Context() {}; virtual ~Context() {};
egl::Display *const display; egl::Display *const display;
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include "Display.h" #include "Display.h"
#include "main.h" #include "main.h"
#include "libEGL/EGLSurface.h" #include "libEGL/Surface.hpp"
#include "libEGL/Context.hpp" #include "libEGL/Context.hpp"
#include "common/Image.hpp" #include "common/Image.hpp"
#include "common/debug.h" #include "common/debug.h"
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
// such as the client area of a window, including any back buffers. // such as the client area of a window, including any back buffers.
// Implements EGLSurface and related functionality. [EGL 1.4] section 2.2 page 3. // Implements EGLSurface and related functionality. [EGL 1.4] section 2.2 page 3.
#include "EGLSurface.h" #include "Surface.hpp"
#include "main.h" #include "main.h"
#include "Display.h" #include "Display.h"
...@@ -36,9 +36,19 @@ ...@@ -36,9 +36,19 @@
#include <algorithm> #include <algorithm>
namespace egl namespace gl
{
Surface::Surface()
{
}
Surface::~Surface()
{ {
}
}
namespace egl
{
Surface::Surface(const Display *display, const Config *config) : display(display), config(config) Surface::Surface(const Display *display, const Config *config) : display(display), config(config)
{ {
backBuffer = nullptr; backBuffer = nullptr;
......
...@@ -12,15 +12,17 @@ ...@@ -12,15 +12,17 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// Surface.h: Defines the egl::Surface class, representing a drawing surface // Surface.hpp: Defines the egl::Surface class, representing a rendering surface
// such as the client area of a window, including any back buffers. // such as the client area of a window, including any back buffers.
// Implements EGLSurface and related functionality. [EGL 1.4] section 2.2 page 3. // Implements EGLSurface and related functionality. [EGL 1.4] section 2.2 page 3.
#ifndef INCLUDE_SURFACE_H_ #ifndef INCLUDE_EGL_SURFACE_H_
#define INCLUDE_SURFACE_H_ #define INCLUDE_EGL_SURFACE_H_
#include "Main/FrameBuffer.hpp"
#include "common/Object.hpp" #include "common/Object.hpp"
#include "common/Surface.hpp"
#include "Main/FrameBuffer.hpp"
#include <EGL/egl.h> #include <EGL/egl.h>
...@@ -28,27 +30,25 @@ namespace egl ...@@ -28,27 +30,25 @@ namespace egl
{ {
class Display; class Display;
class Config; class Config;
class Texture;
class Image;
class [[clang::lto_visibility_public]] Surface : public gl::Object class Surface : public gl::Surface, public gl::Object
{ {
public: public:
virtual bool initialize(); virtual bool initialize();
virtual void swap() = 0; virtual void swap() = 0;
virtual egl::Image *getRenderTarget(); egl::Image *getRenderTarget() override;
virtual egl::Image *getDepthStencil(); egl::Image *getDepthStencil() override;
void setSwapBehavior(EGLenum swapBehavior); void setSwapBehavior(EGLenum swapBehavior);
void setSwapInterval(EGLint interval); void setSwapInterval(EGLint interval);
virtual EGLint getConfigID() const; virtual EGLint getConfigID() const;
virtual EGLenum getSurfaceType() const; virtual EGLenum getSurfaceType() const;
virtual sw::Format getInternalFormat() const; sw::Format getInternalFormat() const override;
virtual EGLint getWidth() const; EGLint getWidth() const override;
virtual EGLint getHeight() const; EGLint getHeight() const override;
virtual EGLint getPixelAspectRatio() const; virtual EGLint getPixelAspectRatio() const;
virtual EGLenum getRenderBuffer() const; virtual EGLenum getRenderBuffer() const;
virtual EGLenum getSwapBehavior() const; virtual EGLenum getSwapBehavior() const;
...@@ -57,7 +57,7 @@ public: ...@@ -57,7 +57,7 @@ public:
virtual EGLBoolean getLargestPBuffer() const; virtual EGLBoolean getLargestPBuffer() const;
virtual EGLNativeWindowType getWindowHandle() const = 0; virtual EGLNativeWindowType getWindowHandle() const = 0;
virtual void setBoundTexture(egl::Texture *texture); void setBoundTexture(egl::Texture *texture) override;
virtual egl::Texture *getBoundTexture() const; virtual egl::Texture *getBoundTexture() const;
virtual bool isWindowSurface() const { return false; } virtual bool isWindowSurface() const { return false; }
...@@ -66,7 +66,7 @@ public: ...@@ -66,7 +66,7 @@ public:
protected: protected:
Surface(const Display *display, const Config *config); Surface(const Display *display, const Config *config);
virtual ~Surface(); ~Surface() override;
virtual void deleteResources(); virtual void deleteResources();
...@@ -134,4 +134,4 @@ private: ...@@ -134,4 +134,4 @@ private:
}; };
} }
#endif // INCLUDE_SURFACE_H_ #endif // INCLUDE_EGL_SURFACE_H_
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include "main.h" #include "main.h"
#include "Display.h" #include "Display.h"
#include "EGLSurface.h" #include "Surface.hpp"
#include "Texture.hpp" #include "Texture.hpp"
#include "Context.hpp" #include "Context.hpp"
#include "common/Image.hpp" #include "common/Image.hpp"
......
...@@ -319,13 +319,14 @@ copy "$(OutDir)libEGL.dll" "$(SolutionDir)lib\$(Configuration)_$(Platform)\trans ...@@ -319,13 +319,14 @@ copy "$(OutDir)libEGL.dll" "$(SolutionDir)lib\$(Configuration)_$(Platform)\trans
<ClCompile Include="Display.cpp" /> <ClCompile Include="Display.cpp" />
<ClCompile Include="libEGL.cpp" /> <ClCompile Include="libEGL.cpp" />
<ClCompile Include="main.cpp" /> <ClCompile Include="main.cpp" />
<ClCompile Include="EGLSurface.cpp" /> <ClCompile Include="Surface.cpp" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\common\debug.h" /> <ClInclude Include="..\common\debug.h" />
<ClInclude Include="..\common\Image.hpp" /> <ClInclude Include="..\common\Image.hpp" />
<ClInclude Include="..\common\NameSpace.hpp" /> <ClInclude Include="..\common\NameSpace.hpp" />
<ClInclude Include="..\common\Object.hpp" /> <ClInclude Include="..\common\Object.hpp" />
<ClInclude Include="..\common\Surface.hpp" />
<ClInclude Include="..\include\EGL\egl.h" /> <ClInclude Include="..\include\EGL\egl.h" />
<ClInclude Include="..\include\EGL\eglext.h" /> <ClInclude Include="..\include\EGL\eglext.h" />
<ClInclude Include="..\include\EGL\eglplatform.h" /> <ClInclude Include="..\include\EGL\eglplatform.h" />
...@@ -335,7 +336,7 @@ copy "$(OutDir)libEGL.dll" "$(SolutionDir)lib\$(Configuration)_$(Platform)\trans ...@@ -335,7 +336,7 @@ copy "$(OutDir)libEGL.dll" "$(SolutionDir)lib\$(Configuration)_$(Platform)\trans
<ClInclude Include="libEGL.hpp" /> <ClInclude Include="libEGL.hpp" />
<ClInclude Include="main.h" /> <ClInclude Include="main.h" />
<ClInclude Include="resource.h" /> <ClInclude Include="resource.h" />
<ClInclude Include="EGLSurface.h" /> <ClInclude Include="Surface.hpp" />
<ClInclude Include="Sync.hpp" /> <ClInclude Include="Sync.hpp" />
<ClInclude Include="Texture.hpp" /> <ClInclude Include="Texture.hpp" />
</ItemGroup> </ItemGroup>
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<ClCompile Include="..\common\Object.cpp"> <ClCompile Include="..\common\Object.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="EGLSurface.cpp"> <ClCompile Include="Surface.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
</ItemGroup> </ItemGroup>
...@@ -79,7 +79,10 @@ ...@@ -79,7 +79,10 @@
<ClInclude Include="..\common\NameSpace.hpp"> <ClInclude Include="..\common\NameSpace.hpp">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="EGLSurface.h"> <ClInclude Include="..\common\Surface.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Surface.hpp">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
</ItemGroup> </ItemGroup>
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include "libEGL.hpp" #include "libEGL.hpp"
#include "Context.hpp" #include "Context.hpp"
#include "EGLSurface.h" #include "Surface.hpp"
#include "resource.h" #include "resource.h"
#include "Common/Thread.hpp" #include "Common/Thread.hpp"
......
...@@ -28,6 +28,8 @@ namespace egl ...@@ -28,6 +28,8 @@ namespace egl
class Display; class Display;
class Context; class Context;
class Surface; class Surface;
class Config;
class Image;
struct Current struct Current
{ {
...@@ -76,12 +78,6 @@ namespace egl ...@@ -76,12 +78,6 @@ namespace egl
return returnValue; return returnValue;
} }
class Config;
class Surface;
class Display;
class Context;
class Image;
} }
extern LibGLES_CM libGLES_CM; extern LibGLES_CM libGLES_CM;
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include "VertexDataManager.h" #include "VertexDataManager.h"
#include "IndexDataManager.h" #include "IndexDataManager.h"
#include "libEGL/Display.h" #include "libEGL/Display.h"
#include "libEGL/EGLSurface.h" #include "common/Surface.hpp"
#include "Common/Half.hpp" #include "Common/Half.hpp"
#include <EGL/eglext.h> #include <EGL/eglext.h>
...@@ -281,7 +281,7 @@ Context::~Context() ...@@ -281,7 +281,7 @@ Context::~Context()
delete device; delete device;
} }
void Context::makeCurrent(egl::Surface *surface) void Context::makeCurrent(gl::Surface *surface)
{ {
if(!mHasBeenCurrent) if(!mHasBeenCurrent)
{ {
...@@ -3095,7 +3095,7 @@ void Context::setVertexAttrib(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLf ...@@ -3095,7 +3095,7 @@ void Context::setVertexAttrib(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLf
mVertexDataManager->dirtyCurrentValue(index); mVertexDataManager->dirtyCurrentValue(index);
} }
void Context::bindTexImage(egl::Surface *surface) void Context::bindTexImage(gl::Surface *surface)
{ {
es1::Texture2D *textureObject = getTexture2D(); es1::Texture2D *textureObject = getTexture2D();
......
...@@ -33,10 +33,11 @@ ...@@ -33,10 +33,11 @@
#include <map> #include <map>
#include <string> #include <string>
namespace gl { class Surface; }
namespace egl namespace egl
{ {
class Display; class Display;
class Surface;
class Config; class Config;
} }
...@@ -296,7 +297,7 @@ class [[clang::lto_visibility_public]] Context : public egl::Context ...@@ -296,7 +297,7 @@ class [[clang::lto_visibility_public]] Context : public egl::Context
public: public:
Context(egl::Display *display, const Context *shareContext, const egl::Config *config); Context(egl::Display *display, const Context *shareContext, const egl::Config *config);
void makeCurrent(egl::Surface *surface) override; void makeCurrent(gl::Surface *surface) override;
EGLint getClientVersion() const override; EGLint getClientVersion() const override;
EGLint getConfigID() const override; EGLint getConfigID() const override;
...@@ -508,9 +509,9 @@ public: ...@@ -508,9 +509,9 @@ public:
static int getSupportedMultisampleCount(int requested); static int getSupportedMultisampleCount(int requested);
virtual void bindTexImage(egl::Surface *surface); void bindTexImage(gl::Surface *surface) override;
virtual EGLenum validateSharedImage(EGLenum target, GLuint name, GLuint textureLevel); EGLenum validateSharedImage(EGLenum target, GLuint name, GLuint textureLevel) override;
virtual egl::Image *createSharedImage(EGLenum target, GLuint name, GLuint textureLevel); egl::Image *createSharedImage(EGLenum target, GLuint name, GLuint textureLevel) override;
egl::Image *getSharedImage(GLeglImageOES image); egl::Image *getSharedImage(GLeglImageOES image);
Device *getDevice(); Device *getDevice();
...@@ -579,7 +580,7 @@ public: ...@@ -579,7 +580,7 @@ public:
void setPointFadeThresholdSize(float threshold); void setPointFadeThresholdSize(float threshold);
private: private:
virtual ~Context(); ~Context() override;
bool applyRenderTarget(); bool applyRenderTarget();
void applyState(GLenum drawMode); void applyState(GLenum drawMode);
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include "Framebuffer.h" #include "Framebuffer.h"
#include "Device.hpp" #include "Device.hpp"
#include "libEGL/Display.h" #include "libEGL/Display.h"
#include "libEGL/EGLSurface.h" #include "common/Surface.hpp"
#include "common/debug.h" #include "common/debug.h"
#include <algorithm> #include <algorithm>
...@@ -474,7 +474,7 @@ void Texture2D::setImage(GLint level, GLsizei width, GLsizei height, GLenum form ...@@ -474,7 +474,7 @@ void Texture2D::setImage(GLint level, GLsizei width, GLsizei height, GLenum form
Texture::setImage(format, type, unpackAlignment, pixels, image[level]); Texture::setImage(format, type, unpackAlignment, pixels, image[level]);
} }
void Texture2D::bindTexImage(egl::Surface *surface) void Texture2D::bindTexImage(gl::Surface *surface)
{ {
GLenum format; GLenum format;
......
...@@ -29,11 +29,8 @@ ...@@ -29,11 +29,8 @@
#include <vector> #include <vector>
namespace egl namespace gl { class Surface; }
{ namespace egl { class Config; }
class Surface;
class Config;
}
namespace es1 namespace es1
{ {
...@@ -155,7 +152,7 @@ public: ...@@ -155,7 +152,7 @@ public:
virtual bool isSamplerComplete() const; virtual bool isSamplerComplete() const;
virtual bool isCompressed(GLenum target, GLint level) const; virtual bool isCompressed(GLenum target, GLint level) const;
virtual bool isDepth(GLenum target, GLint level) const; virtual bool isDepth(GLenum target, GLint level) const;
virtual void bindTexImage(egl::Surface *surface); virtual void bindTexImage(gl::Surface *surface);
virtual void releaseTexImage(); virtual void releaseTexImage();
virtual void generateMipmaps(); virtual void generateMipmaps();
...@@ -174,7 +171,7 @@ protected: ...@@ -174,7 +171,7 @@ protected:
egl::Image *image[IMPLEMENTATION_MAX_TEXTURE_LEVELS]; egl::Image *image[IMPLEMENTATION_MAX_TEXTURE_LEVELS];
egl::Surface *mSurface; gl::Surface *mSurface;
// A specific internal reference count is kept for colorbuffer proxy references, // A specific internal reference count is kept for colorbuffer proxy references,
// because, as the renderbuffer acting as proxy will maintain a binding pointer // because, as the renderbuffer acting as proxy will maintain a binding pointer
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include "libGLES_CM.hpp" #include "libGLES_CM.hpp"
#include "Framebuffer.h" #include "Framebuffer.h"
#include "libEGL/EGLSurface.h" #include "common/Surface.hpp"
#include "Common/Thread.hpp" #include "Common/Thread.hpp"
#include "Common/SharedLibrary.hpp" #include "Common/SharedLibrary.hpp"
#include "common/debug.h" #include "common/debug.h"
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include "VertexDataManager.h" #include "VertexDataManager.h"
#include "IndexDataManager.h" #include "IndexDataManager.h"
#include "libEGL/Display.h" #include "libEGL/Display.h"
#include "libEGL/EGLSurface.h" #include "common/Surface.hpp"
#include "Common/Half.hpp" #include "Common/Half.hpp"
#include <EGL/eglext.h> #include <EGL/eglext.h>
...@@ -265,7 +265,7 @@ Context::~Context() ...@@ -265,7 +265,7 @@ Context::~Context()
delete device; delete device;
} }
void Context::makeCurrent(egl::Surface *surface) void Context::makeCurrent(gl::Surface *surface)
{ {
if(!mHasBeenCurrent) if(!mHasBeenCurrent)
{ {
...@@ -4138,7 +4138,7 @@ void Context::blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1 ...@@ -4138,7 +4138,7 @@ void Context::blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1
} }
} }
void Context::bindTexImage(egl::Surface *surface) void Context::bindTexImage(gl::Surface *surface)
{ {
es2::Texture2D *textureObject = getTexture2D(); es2::Texture2D *textureObject = getTexture2D();
......
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
namespace egl namespace egl
{ {
class Display; class Display;
class Surface;
class Config; class Config;
} }
...@@ -431,7 +430,7 @@ class [[clang::lto_visibility_public]] Context : public egl::Context ...@@ -431,7 +430,7 @@ class [[clang::lto_visibility_public]] Context : public egl::Context
public: public:
Context(egl::Display *display, const Context *shareContext, EGLint clientVersion, const egl::Config *config); Context(egl::Display *display, const Context *shareContext, EGLint clientVersion, const egl::Config *config);
void makeCurrent(egl::Surface *surface) override; void makeCurrent(gl::Surface *surface) override;
EGLint getClientVersion() const override; EGLint getClientVersion() const override;
EGLint getConfigID() const override; EGLint getConfigID() const override;
...@@ -691,7 +690,7 @@ public: ...@@ -691,7 +690,7 @@ public:
GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
GLbitfield mask, bool filter, bool allowPartialDepthStencilBlit); GLbitfield mask, bool filter, bool allowPartialDepthStencilBlit);
void bindTexImage(egl::Surface *surface) override; void bindTexImage(gl::Surface *surface) override;
EGLenum validateSharedImage(EGLenum target, GLuint name, GLuint textureLevel) override; EGLenum validateSharedImage(EGLenum target, GLuint name, GLuint textureLevel) override;
egl::Image *createSharedImage(EGLenum target, GLuint name, GLuint textureLevel) override; egl::Image *createSharedImage(EGLenum target, GLuint name, GLuint textureLevel) override;
egl::Image *getSharedImage(GLeglImageOES image); egl::Image *getSharedImage(GLeglImageOES image);
...@@ -701,7 +700,7 @@ public: ...@@ -701,7 +700,7 @@ public:
const GLubyte *getExtensions(GLuint index, GLuint *numExt = nullptr) const; const GLubyte *getExtensions(GLuint index, GLuint *numExt = nullptr) const;
private: private:
virtual ~Context(); ~Context() override;
void applyScissor(int width, int height); void applyScissor(int width, int height);
bool applyRenderTarget(); bool applyRenderTarget();
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include "Framebuffer.h" #include "Framebuffer.h"
#include "Device.hpp" #include "Device.hpp"
#include "libEGL/Display.h" #include "libEGL/Display.h"
#include "libEGL/EGLSurface.h" #include "common/Surface.hpp"
#include "common/debug.h" #include "common/debug.h"
#include <algorithm> #include <algorithm>
...@@ -650,7 +650,7 @@ void Texture2D::setImage(GLint level, GLsizei width, GLsizei height, GLenum form ...@@ -650,7 +650,7 @@ void Texture2D::setImage(GLint level, GLsizei width, GLsizei height, GLenum form
Texture::setImage(format, type, unpackInfo, pixels, image[level]); Texture::setImage(format, type, unpackInfo, pixels, image[level]);
} }
void Texture2D::bindTexImage(egl::Surface *surface) void Texture2D::bindTexImage(gl::Surface *surface)
{ {
GLenum format; GLenum format;
...@@ -1611,7 +1611,7 @@ void Texture3D::setImage(GLint level, GLsizei width, GLsizei height, GLsizei dep ...@@ -1611,7 +1611,7 @@ void Texture3D::setImage(GLint level, GLsizei width, GLsizei height, GLsizei dep
Texture::setImage(format, type, unpackInfo, pixels, image[level]); Texture::setImage(format, type, unpackInfo, pixels, image[level]);
} }
void Texture3D::bindTexImage(egl::Surface *surface) void Texture3D::bindTexImage(gl::Surface *surface)
{ {
GLenum format; GLenum format;
......
...@@ -29,11 +29,8 @@ ...@@ -29,11 +29,8 @@
#include <vector> #include <vector>
namespace egl namespace gl { class Surface; }
{ namespace egl { class Config; }
class Surface;
class Config;
}
namespace es2 namespace es2
{ {
...@@ -180,7 +177,7 @@ public: ...@@ -180,7 +177,7 @@ public:
virtual bool isSamplerComplete() const; virtual bool isSamplerComplete() const;
virtual bool isCompressed(GLenum target, GLint level) const; virtual bool isCompressed(GLenum target, GLint level) const;
virtual bool isDepth(GLenum target, GLint level) const; virtual bool isDepth(GLenum target, GLint level) const;
virtual void bindTexImage(egl::Surface *surface); virtual void bindTexImage(gl::Surface *surface);
virtual void releaseTexImage(); virtual void releaseTexImage();
virtual void generateMipmaps(); virtual void generateMipmaps();
...@@ -198,7 +195,7 @@ protected: ...@@ -198,7 +195,7 @@ protected:
egl::Image *image[IMPLEMENTATION_MAX_TEXTURE_LEVELS]; egl::Image *image[IMPLEMENTATION_MAX_TEXTURE_LEVELS];
egl::Surface *mSurface; gl::Surface *mSurface;
// A specific internal reference count is kept for colorbuffer proxy references, // A specific internal reference count is kept for colorbuffer proxy references,
// because, as the renderbuffer acting as proxy will maintain a binding pointer // because, as the renderbuffer acting as proxy will maintain a binding pointer
...@@ -300,7 +297,7 @@ public: ...@@ -300,7 +297,7 @@ public:
virtual bool isSamplerComplete() const; virtual bool isSamplerComplete() const;
virtual bool isCompressed(GLenum target, GLint level) const; virtual bool isCompressed(GLenum target, GLint level) const;
virtual bool isDepth(GLenum target, GLint level) const; virtual bool isDepth(GLenum target, GLint level) const;
virtual void bindTexImage(egl::Surface *surface); virtual void bindTexImage(gl::Surface *surface);
virtual void releaseTexImage(); virtual void releaseTexImage();
virtual void generateMipmaps(); virtual void generateMipmaps();
...@@ -318,7 +315,7 @@ protected: ...@@ -318,7 +315,7 @@ protected:
egl::Image *image[IMPLEMENTATION_MAX_TEXTURE_LEVELS]; egl::Image *image[IMPLEMENTATION_MAX_TEXTURE_LEVELS];
egl::Surface *mSurface; gl::Surface *mSurface;
// A specific internal reference count is kept for colorbuffer proxy references, // A specific internal reference count is kept for colorbuffer proxy references,
// because, as the renderbuffer acting as proxy will maintain a binding pointer // because, as the renderbuffer acting as proxy will maintain a binding pointer
......
...@@ -365,6 +365,7 @@ copy "$(OutDir)libGLESv2.dll" "$(SolutionDir)lib\$(Configuration)_$(Platform)\tr ...@@ -365,6 +365,7 @@ copy "$(OutDir)libGLESv2.dll" "$(SolutionDir)lib\$(Configuration)_$(Platform)\tr
<ClInclude Include="..\common\Image.hpp" /> <ClInclude Include="..\common\Image.hpp" />
<ClInclude Include="..\common\NameSpace.hpp" /> <ClInclude Include="..\common\NameSpace.hpp" />
<ClInclude Include="..\common\Object.hpp" /> <ClInclude Include="..\common\Object.hpp" />
<ClInclude Include="..\common\Surface.hpp" />
<ClInclude Include="..\include\GLES2\gl2.h" /> <ClInclude Include="..\include\GLES2\gl2.h" />
<ClInclude Include="..\include\GLES2\gl2ext.h" /> <ClInclude Include="..\include\GLES2\gl2ext.h" />
<ClInclude Include="..\include\GLES2\gl2platform.h" /> <ClInclude Include="..\include\GLES2\gl2platform.h" />
......
...@@ -163,6 +163,9 @@ ...@@ -163,6 +163,9 @@
<ClInclude Include="..\common\Image.hpp"> <ClInclude Include="..\common\Image.hpp">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\common\Surface.hpp">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ResourceCompile Include="libGLESv2.rc" /> <ResourceCompile Include="libGLESv2.rc" />
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include "libGLESv2.hpp" #include "libGLESv2.hpp"
#include "Framebuffer.h" #include "Framebuffer.h"
#include "libEGL/main.h" #include "libEGL/main.h"
#include "libEGL/EGLSurface.h" #include "common/Surface.hpp"
#include "Common/Thread.hpp" #include "Common/Thread.hpp"
#include "Common/SharedLibrary.hpp" #include "Common/SharedLibrary.hpp"
#include "common/debug.h" #include "common/debug.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