summaryrefslogtreecommitdiffstats
path: root/gfx/angle/src/libANGLE/ContextState.h
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/angle/src/libANGLE/ContextState.h')
-rwxr-xr-xgfx/angle/src/libANGLE/ContextState.h57
1 files changed, 32 insertions, 25 deletions
diff --git a/gfx/angle/src/libANGLE/ContextState.h b/gfx/angle/src/libANGLE/ContextState.h
index 494c1a3da..ecb3759f4 100755
--- a/gfx/angle/src/libANGLE/ContextState.h
+++ b/gfx/angle/src/libANGLE/ContextState.h
@@ -11,35 +11,51 @@
#include "common/angleutils.h"
#include "libANGLE/State.h"
-#include "libANGLE/Version.h"
namespace gl
{
class ValidationContext;
class ContextState;
-static constexpr Version ES_2_0 = Version(2, 0);
-static constexpr Version ES_3_0 = Version(3, 0);
-static constexpr Version ES_3_1 = Version(3, 1);
+class GLVersion final : angle::NonCopyable
+{
+ public:
+ GLVersion(GLint clientMajorVersion, GLint clientMinorVersion)
+ : mClientMajorVersion(clientMajorVersion), mClientMinorVersion(clientMinorVersion)
+ {
+ }
+
+ GLint getClientMajorVersion() const { return mClientMajorVersion; }
+ GLint getClientMinorVersion() const { return mClientMinorVersion; }
+
+ bool isES2() const { return mClientMajorVersion == 2; }
+ bool isES3() const { return mClientMajorVersion == 3 && mClientMinorVersion == 0; }
+ bool isES31() const { return mClientMajorVersion == 3 && mClientMinorVersion == 1; }
+ bool isES3OrGreater() const { return mClientMajorVersion >= 3; }
+
+ private:
+ GLint mClientMajorVersion;
+ GLint mClientMinorVersion;
+};
class ContextState final : public angle::NonCopyable
{
public:
ContextState(uintptr_t context,
- const Version &clientVersion,
+ GLint clientMajorVersion,
+ GLint clientMinorVersion,
State *state,
const Caps &caps,
const TextureCapsMap &textureCaps,
const Extensions &extensions,
const ResourceManager *resourceManager,
- const Limitations &limitations,
- const ResourceMap<Framebuffer> &framebufferMap);
+ const Limitations &limitations);
~ContextState();
uintptr_t getContext() const { return mContext; }
- GLint getClientMajorVersion() const { return mClientVersion.major; }
- GLint getClientMinorVersion() const { return mClientVersion.minor; }
- const Version &getClientVersion() const { return mClientVersion; }
+ GLint getClientMajorVersion() const { return mGLVersion.getClientMajorVersion(); }
+ GLint getClientMinorVersion() const { return mGLVersion.getClientMinorVersion(); }
+ const GLVersion &getGLVersion() const { return mGLVersion; }
const State &getState() const { return *mState; }
const Caps &getCaps() const { return mCaps; }
const TextureCapsMap &getTextureCaps() const { return mTextureCaps; }
@@ -53,7 +69,7 @@ class ContextState final : public angle::NonCopyable
friend class Context;
friend class ValidationContext;
- Version mClientVersion;
+ GLVersion mGLVersion;
uintptr_t mContext;
State *mState;
const Caps &mCaps;
@@ -61,29 +77,28 @@ class ContextState final : public angle::NonCopyable
const Extensions &mExtensions;
const ResourceManager *mResourceManager;
const Limitations &mLimitations;
- const ResourceMap<Framebuffer> &mFramebufferMap;
};
class ValidationContext : angle::NonCopyable
{
public:
- ValidationContext(const Version &clientVersion,
+ ValidationContext(GLint clientMajorVersion,
+ GLint clientMinorVersion,
State *state,
const Caps &caps,
const TextureCapsMap &textureCaps,
const Extensions &extensions,
const ResourceManager *resourceManager,
const Limitations &limitations,
- const ResourceMap<Framebuffer> &framebufferMap,
bool skipValidation);
virtual ~ValidationContext() {}
virtual void handleError(const Error &error) = 0;
const ContextState &getContextState() const { return mState; }
- GLint getClientMajorVersion() const { return mState.getClientMajorVersion(); }
- GLint getClientMinorVersion() const { return mState.getClientMinorVersion(); }
- const Version &getClientVersion() const { return mState.getClientVersion(); }
+ int getClientMajorVersion() const { return mState.getClientMajorVersion(); }
+ int getClientMinorVersion() const { return mState.getClientMinorVersion(); }
+ const GLVersion &getGLVersion() const { return mState.mGLVersion; }
const State &getGLState() const { return mState.getState(); }
const Caps &getCaps() const { return mState.getCaps(); }
const TextureCapsMap &getTextureCaps() const { return mState.getTextureCaps(); }
@@ -95,14 +110,6 @@ class ValidationContext : angle::NonCopyable
bool getQueryParameterInfo(GLenum pname, GLenum *type, unsigned int *numParams);
bool getIndexedQueryParameterInfo(GLenum target, GLenum *type, unsigned int *numParams);
- Program *getProgram(GLuint handle) const;
- Shader *getShader(GLuint handle) const;
-
- bool isTextureGenerated(GLuint texture) const;
- bool isBufferGenerated(GLuint buffer) const;
- bool isRenderbufferGenerated(GLuint renderbuffer) const;
- bool isFramebufferGenerated(GLuint framebuffer) const;
-
protected:
ContextState mState;
bool mSkipValidation;