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

Unified Diff: ui/gl/gl_gl_api_implementation.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 | « ui/gl/gl_enums_implementation_autogen.h ('k') | ui/gl/gl_implementation_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_gl_api_implementation.cc
diff --git a/ui/gl/gl_gl_api_implementation.cc b/ui/gl/gl_gl_api_implementation.cc
index 81a1b72657ba0d841f9fd8780f68f57260160609..5bea3f12ae977e0621f536b41d609b9b5a09daab 100644
--- a/ui/gl/gl_gl_api_implementation.cc
+++ b/ui/gl/gl_gl_api_implementation.cc
@@ -466,11 +466,15 @@ bool VirtualGLApi::MakeCurrent(GLContext* virtual_context, GLSurface* surface) {
}
}
+ bool state_dirtied_externally = real_context_->GetStateWasDirtiedExternally();
+ real_context_->SetStateWasDirtiedExternally(false);
+
DCHECK_EQ(real_context_, GLContext::GetRealCurrent());
DCHECK(real_context_->IsCurrent(NULL));
DCHECK(virtual_context->IsCurrent(surface));
- if (switched_contexts || virtual_context != current_context_) {
+ if (state_dirtied_externally || switched_contexts ||
+ virtual_context != current_context_) {
#if DCHECK_IS_ON()
GLenum error = glGetErrorFn();
// Accepting a context loss error here enables using debug mode to work on
@@ -485,7 +489,7 @@ bool VirtualGLApi::MakeCurrent(GLContext* virtual_context, GLSurface* surface) {
SetGLToRealGLApi();
if (virtual_context->GetGLStateRestorer()->IsInitialized()) {
virtual_context->GetGLStateRestorer()->RestoreState(
- (current_context_ && !switched_contexts)
+ (current_context_ && !state_dirtied_externally && !switched_contexts)
? current_context_->GetGLStateRestorer()
: NULL);
}
« no previous file with comments | « ui/gl/gl_enums_implementation_autogen.h ('k') | ui/gl/gl_implementation_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698