Add a ValidationContext class helper.
This class is a wrapper around gl::Data, aka the metadata describing
a gl::Context. We can use it for unit-testing validation functions
by passing that through the validation methods instead of a Context,
and using mocks to expect certain errors.
BUG=angleproject:747
BUG=angleproject:597
Change-Id: I7bd85c7662860ba9a3a13406579a088d447e5631
Reviewed-on: https://chromium-review.googlesource.com/309637
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/Context.cpp b/src/libANGLE/Context.cpp
index 5fa30b2..1a1bcd2 100644
--- a/src/libANGLE/Context.cpp
+++ b/src/libANGLE/Context.cpp
@@ -63,16 +63,16 @@
rx::Renderer *renderer,
bool notifyResets,
bool robustAccess)
- : mRenderer(renderer),
+ : ValidationContext(clientVersion,
+ mState,
+ mCaps,
+ mTextureCaps,
+ mExtensions,
+ nullptr,
+ mLimitations),
+ mRenderer(renderer),
mConfig(config),
- mCurrentSurface(nullptr),
- mData(reinterpret_cast<uintptr_t>(this),
- clientVersion,
- mState,
- mCaps,
- mTextureCaps,
- mExtensions,
- nullptr)
+ mCurrentSurface(nullptr)
{
ASSERT(robustAccess == false); // Unimplemented
@@ -1465,11 +1465,6 @@
return (mResetStrategy == GL_LOSE_CONTEXT_ON_RESET_EXT);
}
-int Context::getClientVersion() const
-{
- return mClientVersion;
-}
-
const egl::Config *Context::getConfig() const
{
return mConfig;
@@ -1497,26 +1492,6 @@
}
}
-const Caps &Context::getCaps() const
-{
- return mCaps;
-}
-
-const TextureCapsMap &Context::getTextureCaps() const
-{
- return mTextureCaps;
-}
-
-const Extensions &Context::getExtensions() const
-{
- return mExtensions;
-}
-
-const Limitations &Context::getLimitations() const
-{
- return mLimitations;
-}
-
void Context::detachTexture(GLuint texture)
{
// Simple pass-through to State's detachTexture method, as textures do not require