Pass ContextImpl to Framebuffer methods instead of ContextState.

BUG=angleproject:1363

Change-Id: I7e7524d95f2ca31c35918f9fe5c0cb681ed93616
Reviewed-on: https://chromium-review.googlesource.com/340746
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/Context.cpp b/src/libANGLE/Context.cpp
index 2e89b81..eaa4a51 100644
--- a/src/libANGLE/Context.cpp
+++ b/src/libANGLE/Context.cpp
@@ -134,7 +134,7 @@
                         nullptr,
                         mLimitations,
                         GetNoError(attribs)),
-      mImplementation(renderer->createContext()),
+      mImplementation(renderer->createContext(getData())),
       mCompiler(nullptr),
       mRenderer(renderer),
       mClientVersion(GetClientVersion(attribs)),
@@ -2158,9 +2158,6 @@
                               GLbitfield mask,
                               GLenum filter)
 {
-    Framebuffer *readFramebuffer = mState.getReadFramebuffer();
-    ASSERT(readFramebuffer);
-
     Framebuffer *drawFramebuffer = mState.getDrawFramebuffer();
     ASSERT(drawFramebuffer);
 
@@ -2169,31 +2166,34 @@
 
     syncStateForBlit();
 
-    handleError(drawFramebuffer->blit(mState, srcArea, dstArea, mask, filter, readFramebuffer));
+    handleError(drawFramebuffer->blit(mImplementation.get(), srcArea, dstArea, mask, filter));
 }
 
 void Context::clear(GLbitfield mask)
 {
     syncStateForClear();
-    handleError(mState.getDrawFramebuffer()->clear(mData, mask));
+    handleError(mState.getDrawFramebuffer()->clear(mImplementation.get(), mask));
 }
 
 void Context::clearBufferfv(GLenum buffer, GLint drawbuffer, const GLfloat *values)
 {
     syncStateForClear();
-    handleError(mState.getDrawFramebuffer()->clearBufferfv(mData, buffer, drawbuffer, values));
+    handleError(mState.getDrawFramebuffer()->clearBufferfv(mImplementation.get(), buffer,
+                                                           drawbuffer, values));
 }
 
 void Context::clearBufferuiv(GLenum buffer, GLint drawbuffer, const GLuint *values)
 {
     syncStateForClear();
-    handleError(mState.getDrawFramebuffer()->clearBufferuiv(mData, buffer, drawbuffer, values));
+    handleError(mState.getDrawFramebuffer()->clearBufferuiv(mImplementation.get(), buffer,
+                                                            drawbuffer, values));
 }
 
 void Context::clearBufferiv(GLenum buffer, GLint drawbuffer, const GLint *values)
 {
     syncStateForClear();
-    handleError(mState.getDrawFramebuffer()->clearBufferiv(mData, buffer, drawbuffer, values));
+    handleError(mState.getDrawFramebuffer()->clearBufferiv(mImplementation.get(), buffer,
+                                                           drawbuffer, values));
 }
 
 void Context::clearBufferfi(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil)
@@ -2209,7 +2209,8 @@
     }
 
     syncStateForClear();
-    handleError(framebufferObject->clearBufferfi(mData, buffer, drawbuffer, depth, stencil));
+    handleError(framebufferObject->clearBufferfi(mImplementation.get(), buffer, drawbuffer, depth,
+                                                 stencil));
 }
 
 void Context::readPixels(GLint x,
@@ -2226,7 +2227,7 @@
     ASSERT(framebufferObject);
 
     Rectangle area(x, y, width, height);
-    handleError(framebufferObject->readPixels(mState, area, format, type, pixels));
+    handleError(framebufferObject->readPixels(mImplementation.get(), area, format, type, pixels));
 }
 
 void Context::copyTexImage2D(GLenum target,