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

Unified Diff: gpu/command_buffer/service/gl_context_virtual.cc

Issue 2852353003: Add more strict DCHECKs around context state. (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 | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gl_context_virtual.cc
diff --git a/gpu/command_buffer/service/gl_context_virtual.cc b/gpu/command_buffer/service/gl_context_virtual.cc
index 2582d00a754fc193d6cf1bb48e3c6aaad8217e73..51cc84fb2e969f57c75efa421067e7e032fba221 100644
--- a/gpu/command_buffer/service/gl_context_virtual.cc
+++ b/gpu/command_buffer/service/gl_context_virtual.cc
@@ -51,10 +51,12 @@ bool GLContextVirtual::IsCurrent(gl::GLSurface* surface) {
// If it's a real surface it needs to be current.
if (surface &&
!surface->IsOffscreen())
- return shared_context_->IsCurrent(surface);
+ return shared_context_->IsCurrent(surface) &&
+ shared_context_->current_virtual_context_ == this;
// Otherwise, only insure the context itself is current.
- return shared_context_->IsCurrent(NULL);
+ return shared_context_->IsCurrent(NULL) &&
+ shared_context_->current_virtual_context_ == this;
piman 2017/05/03 19:47:41 One feature of this code is to avoid calling eglMa
Zhenyao Mo 2017/05/03 22:21:34 Thanks for pointing this out, although this design
}
void* GLContextVirtual::GetHandle() {
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698