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

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

Issue 1013463003: Update from https://crrev.com/320931 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 9 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/command_buffer/service/gl_context_virtual.h ('k') | 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 7747407cf6dfba7887bd043afb45bd445fb1afba..0857a521787052d9eba3317cd21eab189f4baec0 100644
--- a/gpu/command_buffer/service/gl_context_virtual.cc
+++ b/gpu/command_buffer/service/gl_context_virtual.cc
@@ -6,6 +6,7 @@
#include "gpu/command_buffer/service/gl_state_restorer_impl.h"
#include "gpu/command_buffer/service/gles2_cmd_decoder.h"
+#include "ui/gl/gl_gl_api_implementation.h"
#include "ui/gl/gl_surface.h"
#include "ui/gl/gpu_timing.h"
@@ -114,6 +115,21 @@ void GLContextVirtual::SetUnbindFboOnMakeCurrent() {
shared_context_->SetUnbindFboOnMakeCurrent();
}
+base::Closure GLContextVirtual::GetStateWasDirtiedExternallyCallback() {
+ return shared_context_->GetStateWasDirtiedExternallyCallback();
+}
+
+void GLContextVirtual::RestoreStateIfDirtiedExternally() {
+ // The dirty bit should only be cleared after the state has been restored,
+ // which should be done only when the context is current.
+ DCHECK(IsCurrent(NULL));
+ if (!shared_context_->GetStateWasDirtiedExternally())
+ return;
+ gfx::ScopedSetGLToRealGLApi scoped_set_gl_api;
+ GetGLStateRestorer()->RestoreState(NULL);
+ shared_context_->SetStateWasDirtiedExternally(false);
+}
+
GLContextVirtual::~GLContextVirtual() {
Destroy();
}
« no previous file with comments | « gpu/command_buffer/service/gl_context_virtual.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698