Don't use GLStateRestorer with the passthrough command decoder.

The passthrough command decoder does not implement the state restoration
functions because it does not track state. When a GLStateRestorer
exists, it is used for the scoped binders in ui/gl/scoped_binders.h and
leads to incorrect state being applied.


Change-Id: I18937597fc02562dfaf01d67a9d4a1b8b84290a3
Reviewed-by: Kenneth Russell <>
Commit-Queue: Geoff Lang <>
Cr-Commit-Position: refs/heads/master@{#672107}
diff --git a/gpu/ipc/service/ b/gpu/ipc/service/
index 92cf96b..28cc844 100644
--- a/gpu/ipc/service/
+++ b/gpu/ipc/service/
@@ -329,7 +329,11 @@
     return gpu::ContextResult::kTransientFailure;
-  if (!context->GetGLStateRestorer()) {
+  // The GLStateRestorer is not used with the passthrough command decoder
+  // because not all state is tracked in the decoder. Virtualized contexts are
+  // also not used.
+  if (!context->GetGLStateRestorer() &&
+      !context_group_->use_passthrough_cmd_decoder()) {
         new GLStateRestorerImpl(gles2_decoder_->AsWeakPtr()));