Cherry-pick: Keep Compositor Offscreen context in sync compositor

Clean cherry-pick of crrev.com/r253081

Original description:

This is used as the share context for video on main thread. Until we can
properly clean up the video context, just skip releasing the this
context to avoid issues during mode switch.

BUG: 13328348

Change-Id: Ie0c10a932299f395c0acdac4c47477541aae0c51
diff --git a/content/browser/android/in_process/synchronous_compositor_factory_impl.cc b/content/browser/android/in_process/synchronous_compositor_factory_impl.cc
index 754180f..3ffbca7 100644
--- a/content/browser/android/in_process/synchronous_compositor_factory_impl.cc
+++ b/content/browser/android/in_process/synchronous_compositor_factory_impl.cc
@@ -206,25 +206,9 @@
 }
 
 void SynchronousCompositorFactoryImpl::CompositorReleasedHardwareDraw() {
-  bool should_release_resources = false;
-  {
-    base::AutoLock lock(num_hardware_compositor_lock_);
-    DCHECK_GT(num_hardware_compositors_, 0u);
-    num_hardware_compositors_--;
-    should_release_resources = num_hardware_compositors_ == 0u;
-  }
-  if (should_release_resources)
-    ReleaseGlobalHardwareResources();
-}
-
-void SynchronousCompositorFactoryImpl::ReleaseGlobalHardwareResources() {
-  {
-    base::AutoLock lock(offscreen_context_for_compositor_thread_lock_);
-    offscreen_context_for_compositor_thread_ = NULL;
-  }
-
-  // TODO(boliu): Properly clean up command buffer server of main thread
-  // context here.
+  base::AutoLock lock(num_hardware_compositor_lock_);
+  DCHECK_GT(num_hardware_compositors_, 0u);
+  num_hardware_compositors_--;
 }
 
 bool SynchronousCompositorFactoryImpl::CanCreateMainThreadContext() {
diff --git a/content/browser/android/in_process/synchronous_compositor_factory_impl.h b/content/browser/android/in_process/synchronous_compositor_factory_impl.h
index 90e3e79..16e9dce 100644
--- a/content/browser/android/in_process/synchronous_compositor_factory_impl.h
+++ b/content/browser/android/in_process/synchronous_compositor_factory_impl.h
@@ -65,7 +65,6 @@
           scoped_refptr<gfx::GLSurface> surface);
 
  private:
-  void ReleaseGlobalHardwareResources();
   bool CanCreateMainThreadContext();
   scoped_refptr<StreamTextureFactorySynchronousImpl::ContextProvider>
       TryCreateStreamTextureFactory();