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/ProgramImpl.h b/src/libANGLE/renderer/ProgramImpl.h
index 30a6a26..7111475 100644
--- a/src/libANGLE/renderer/ProgramImpl.h
+++ b/src/libANGLE/renderer/ProgramImpl.h
@@ -19,6 +19,7 @@
 
 namespace gl
 {
+class Context;
 class VaryingPacking;
 }
 
@@ -29,7 +30,6 @@
 
 namespace rx
 {
-class ContextImpl;
 
 using LinkResult = gl::ErrorOrResult<bool>;
 
@@ -38,16 +38,16 @@
   public:
     ProgramImpl(const gl::ProgramState &state) : mState(state) {}
     virtual ~ProgramImpl() {}
-    virtual void destroy(const ContextImpl *contextImpl) {}
+    virtual void destroy(const gl::Context *context) {}
 
-    virtual LinkResult load(const ContextImpl *contextImpl,
+    virtual LinkResult load(const gl::Context *context,
                             gl::InfoLog &infoLog,
                             gl::BinaryInputStream *stream)  = 0;
     virtual gl::Error save(gl::BinaryOutputStream *stream) = 0;
     virtual void setBinaryRetrievableHint(bool retrievable) = 0;
     virtual void setSeparable(bool separable)               = 0;
 
-    virtual LinkResult link(ContextImpl *contextImpl,
+    virtual LinkResult link(const gl::Context *context,
                             const gl::VaryingPacking &packing,
                             gl::InfoLog &infoLog) = 0;
     virtual GLboolean validate(const gl::Caps &caps, gl::InfoLog *infoLog) = 0;