OSDN Git Service

Make Blitter part of Renderer.
[android-x86/external-swiftshader.git] / src / OpenGL / libGLESv2 / Context.h
index 3a7431a..bbe6ddd 100644 (file)
@@ -37,7 +37,6 @@
 namespace egl
 {
 class Display;
-class Surface;
 class Config;
 }
 
@@ -426,13 +425,14 @@ struct State
        GLint packSkipImages;
 };
 
-class Context : public egl::Context
+class [[clang::lto_visibility_public]] Context : public egl::Context
 {
 public:
-       Context(egl::Display *display, const Context *shareContext, EGLint clientVersion);
+       Context(egl::Display *display, const Context *shareContext, EGLint clientVersion, const egl::Config *config);
 
-       virtual void makeCurrent(egl::Surface *surface);
-       virtual EGLint getClientVersion() const;
+       void makeCurrent(gl::Surface *surface) override;
+       EGLint getClientVersion() const override;
+       EGLint getConfigID() const override;
 
        void markAllStateDirty();
 
@@ -664,6 +664,9 @@ public:
 
        bool hasZeroDivisor() const;
 
+       void drawArrays(GLenum mode, GLint first, GLsizei count, GLsizei instanceCount = 1);
+       void drawElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLsizei instanceCount = 1);
+       void blit(sw::Surface *source, const sw::SliceRect &sRect, sw::Surface *dest, const sw::SliceRect &dRect) override;
        void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei *bufSize, void* pixels);
        void clear(GLbitfield mask);
        void clearColorBuffer(GLint drawbuffer, const GLint *value);
@@ -671,9 +674,7 @@ public:
        void clearColorBuffer(GLint drawbuffer, const GLfloat *value);
        void clearDepthBuffer(const GLfloat value);
        void clearStencilBuffer(const GLint value);
-       void drawArrays(GLenum mode, GLint first, GLsizei count, GLsizei instanceCount = 1);
-       void drawElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLsizei instanceCount = 1);
-       void finish();
+       void finish() override;
        void flush();
 
        void recordInvalidEnum();
@@ -690,9 +691,9 @@ public:
                             GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
                             GLbitfield mask, bool filter, bool allowPartialDepthStencilBlit);
 
-       virtual void bindTexImage(egl::Surface *surface);
-       virtual EGLenum validateSharedImage(EGLenum target, GLuint name, GLuint textureLevel);
-       virtual egl::Image *createSharedImage(EGLenum target, GLuint name, GLuint textureLevel);
+       void bindTexImage(gl::Surface *surface) override;
+       EGLenum validateSharedImage(EGLenum target, GLuint name, GLuint textureLevel) override;
+       egl::Image *createSharedImage(EGLenum target, GLuint name, GLuint textureLevel) override;
        egl::Image *getSharedImage(GLeglImageOES image);
 
        Device *getDevice();
@@ -700,7 +701,7 @@ public:
        const GLubyte *getExtensions(GLuint index, GLuint *numExt = nullptr) const;
 
 private:
-       virtual ~Context();
+       ~Context() override;
 
        void applyScissor(int width, int height);
        bool applyRenderTarget();
@@ -725,6 +726,7 @@ private:
        Query *createQuery(GLuint handle, GLenum type);
 
        const EGLint clientVersion;
+       const egl::Config *const config;
 
        State mState;