Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(195)

Unified Diff: gpu/ipc/service/gpu_command_buffer_stub.cc

Issue 2862443002: Fix bug in virtualized GL context state management upon creation. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/ipc/service/gpu_command_buffer_stub.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/ipc/service/gpu_command_buffer_stub.cc
diff --git a/gpu/ipc/service/gpu_command_buffer_stub.cc b/gpu/ipc/service/gpu_command_buffer_stub.cc
index c30df4b4c2cbe52805f1dfdc5f8bc5037deabf82..d140ddb407a9562112b5c2a26d0036abe00a4b26 100644
--- a/gpu/ipc/service/gpu_command_buffer_stub.cc
+++ b/gpu/ipc/service/gpu_command_buffer_stub.cc
@@ -831,6 +831,21 @@ bool GpuCommandBufferStub::Initialize(
if (offscreen && !active_url_.is_empty())
manager->delegate()->DidCreateOffscreenContext(active_url_);
+ if (use_virtualized_gl_context_) {
+ // If virtualized GL contexts are in use, then real GL context state
+ // is in an indeterminate state, since the GLStateRestorer was not
+ // initialized at the time the GLContextVirtual was made current. In
+ // the case that this command decoder is the next one to be
+ // processed, force a "full" MakeCurrent to be performed. Note that
+ // GpuChannel's initialization of the gpu::Capabilities expects the
+ // context to be left current.
+ context->ReleaseCurrent(surface_.get());
+ if (!context->MakeCurrent(surface_.get())) {
jbauman 2017/05/03 00:53:03 I think this has to go after "initialized_ = true"
+ LOG(ERROR) << "Failed to make context current after initialization.";
+ return false;
+ }
+ }
+
initialized_ = true;
return true;
}
« no previous file with comments | « gpu/ipc/service/gpu_command_buffer_stub.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698