Pass gl::Context to impl methods instead of ContextImpl.
In some cases we might have to call back into the GL layer, passing
the Context, and if we just have a ContextImpl pointer this isn't
possible. It also removes the need for SafeGetImpl.
BUG=angleproject:2044
Change-Id: I6363e84b25648c992c25779d4c43f795aa2866d6
Reviewed-on: https://chromium-review.googlesource.com/516835
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/renderer/gl/ProgramGL.cpp b/src/libANGLE/renderer/gl/ProgramGL.cpp
index b3e5546..ccdcd5d 100644
--- a/src/libANGLE/renderer/gl/ProgramGL.cpp
+++ b/src/libANGLE/renderer/gl/ProgramGL.cpp
@@ -8,17 +8,18 @@
#include "libANGLE/renderer/gl/ProgramGL.h"
-#include "common/bitset_utils.h"
#include "common/angleutils.h"
+#include "common/bitset_utils.h"
#include "common/debug.h"
#include "common/string_utils.h"
#include "common/utilities.h"
+#include "libANGLE/Context.h"
+#include "libANGLE/Uniform.h"
#include "libANGLE/renderer/gl/ContextGL.h"
#include "libANGLE/renderer/gl/FunctionsGL.h"
#include "libANGLE/renderer/gl/ShaderGL.h"
#include "libANGLE/renderer/gl/StateManagerGL.h"
#include "libANGLE/renderer/gl/WorkaroundsGL.h"
-#include "libANGLE/Uniform.h"
#include "platform/Platform.h"
namespace rx
@@ -48,7 +49,7 @@
mProgramID = 0;
}
-LinkResult ProgramGL::load(const ContextImpl *contextImpl,
+LinkResult ProgramGL::load(const gl::Context *context,
gl::InfoLog &infoLog,
gl::BinaryInputStream *stream)
{
@@ -72,7 +73,7 @@
postLink();
// Re-apply UBO bindings to work around driver bugs.
- const WorkaroundsGL &workaroundsGL = GetAs<ContextGL>(contextImpl)->getWorkaroundsGL();
+ const WorkaroundsGL &workaroundsGL = GetImplAs<ContextGL>(context)->getWorkaroundsGL();
if (workaroundsGL.reapplyUBOBindingsAfterLoadingBinaryProgram)
{
for (size_t bindingIndex : mState.getActiveUniformBlockBindingsMask())
@@ -117,7 +118,7 @@
mFunctions->programParameteri(mProgramID, GL_PROGRAM_SEPARABLE, separable ? GL_TRUE : GL_FALSE);
}
-LinkResult ProgramGL::link(ContextImpl *contextImpl,
+LinkResult ProgramGL::link(const gl::Context *context,
const gl::VaryingPacking &packing,
gl::InfoLog &infoLog)
{