Context: Remove recompilation trigger impl method.

Move this down into the D3D11 renderer. Achieve this by passing a
mutable pointer to the memory program cache to the ContextImpl.

This will allow the D3D11 back-end to more easily sync state then
apply state changes. It also cleans up the gl-side Context a bit.

BUG=angleproject:1155

Change-Id: Ia2c63c05cf414e0d0b22b69c3ed7128f0e405933
Reviewed-on: https://chromium-review.googlesource.com/659230
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/Context.cpp b/src/libANGLE/Context.cpp
index f7f58da..c257e3b 100644
--- a/src/libANGLE/Context.cpp
+++ b/src/libANGLE/Context.cpp
@@ -280,6 +280,8 @@
       mScratchBuffer(1000u),
       mZeroFilledBuffer(1000u)
 {
+    mImplementation->setMemoryProgramCache(memoryProgramCache);
+
     initCaps(displayExtensions);
     initWorkarounds();
 
@@ -1750,14 +1752,14 @@
 
 void Context::drawArrays(GLenum mode, GLint first, GLsizei count)
 {
-    ANGLE_CONTEXT_TRY(prepareForDraw(mode));
+    syncRendererState();
     ANGLE_CONTEXT_TRY(mImplementation->drawArrays(this, mode, first, count));
     MarkTransformFeedbackBufferUsage(mGLState.getCurrentTransformFeedback());
 }
 
 void Context::drawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instanceCount)
 {
-    ANGLE_CONTEXT_TRY(prepareForDraw(mode));
+    syncRendererState();
     ANGLE_CONTEXT_TRY(
         mImplementation->drawArraysInstanced(this, mode, first, count, instanceCount));
     MarkTransformFeedbackBufferUsage(mGLState.getCurrentTransformFeedback());
@@ -1765,7 +1767,7 @@
 
 void Context::drawElements(GLenum mode, GLsizei count, GLenum type, const void *indices)
 {
-    ANGLE_CONTEXT_TRY(prepareForDraw(mode));
+    syncRendererState();
     ANGLE_CONTEXT_TRY(mImplementation->drawElements(this, mode, count, type, indices));
 }
 
@@ -1775,7 +1777,7 @@
                                     const void *indices,
                                     GLsizei instances)
 {
-    ANGLE_CONTEXT_TRY(prepareForDraw(mode));
+    syncRendererState();
     ANGLE_CONTEXT_TRY(
         mImplementation->drawElementsInstanced(this, mode, count, type, indices, instances));
 }
@@ -1787,20 +1789,20 @@
                                 GLenum type,
                                 const void *indices)
 {
-    ANGLE_CONTEXT_TRY(prepareForDraw(mode));
+    syncRendererState();
     ANGLE_CONTEXT_TRY(
         mImplementation->drawRangeElements(this, mode, start, end, count, type, indices));
 }
 
 void Context::drawArraysIndirect(GLenum mode, const void *indirect)
 {
-    ANGLE_CONTEXT_TRY(prepareForDraw(mode));
+    syncRendererState();
     ANGLE_CONTEXT_TRY(mImplementation->drawArraysIndirect(this, mode, indirect));
 }
 
 void Context::drawElementsIndirect(GLenum mode, GLenum type, const void *indirect)
 {
-    ANGLE_CONTEXT_TRY(prepareForDraw(mode));
+    syncRendererState();
     ANGLE_CONTEXT_TRY(mImplementation->drawElementsIndirect(this, mode, type, indirect));
 }
 
@@ -2769,20 +2771,6 @@
     mWorkarounds.loseContextOnOutOfMemory = (mResetStrategy == GL_LOSE_CONTEXT_ON_RESET_EXT);
 }
 
-Error Context::prepareForDraw(GLenum drawMode)
-{
-    syncRendererState();
-
-    InfoLog infoLog;
-    Error err = mImplementation->triggerDrawCallProgramRecompilation(this, &infoLog,
-                                                                     mMemoryProgramCache, drawMode);
-    if (err.isError() || infoLog.getLength() > 0)
-    {
-        WARN() << "Dynamic recompilation error log: " << infoLog.str();
-    }
-    return err;
-}
-
 void Context::syncRendererState()
 {
     mGLState.syncDirtyObjects(this);