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

Unified Diff: ui/gl/gl_gl_api_implementation.cc

Issue 118203002: During virtual context switches only restore texture units that have changed from the previous cont… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use the delta between the ContextStates to decide if we should bind a texture or not Created 7 years 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
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 eade3cedaf5e6df54041372b964335aa7937edca..d5465f20e977c805236c7684f784dc27a3790596 100644
--- a/ui/gl/gl_gl_api_implementation.cc
+++ b/ui/gl/gl_gl_api_implementation.cc
@@ -305,17 +305,20 @@ bool VirtualGLApi::MakeCurrent(GLContext* virtual_context, GLSurface* surface) {
// new context.
DCHECK_EQ(glGetErrorFn(), static_cast<GLenum>(GL_NO_ERROR));
- current_context_ = virtual_context;
// Set all state that is different from the real state
- // NOTE: !!! This is a temporary implementation that just restores all
- // state to let us test that it works.
- // TODO: ASAP, change this to something that only restores the state
- // needed for individual GL calls.
GLApi* temp = GetCurrentGLApi();
SetGLToRealGLApi();
- if (virtual_context->GetGLStateRestorer()->IsInitialized())
- virtual_context->GetGLStateRestorer()->RestoreState();
+ if (virtual_context->GetGLStateRestorer()->IsInitialized()) {
+ if (current_context_ == NULL) {
+ LOG(ERROR) << "KAANB: besiktas!";
Ken Russell (switch to Gerrit) 2013/12/19 21:39:33 What does this mean? :)
kaanb 2013/12/20 13:20:31 It's the name of the soccer team I support :) I ne
+ }
+ virtual_context->GetGLStateRestorer()->RestoreState(
+ (current_context_)
no sievers 2013/12/19 21:13:50 && !switched_contexts I.e. only if we are using t
kaanb 2013/12/20 13:20:31 Done.
+ ? current_context_->GetGLStateRestorer()->GetContextState()
+ : NULL);
+ }
SetGLApi(temp);
+ current_context_ = virtual_context;
}
SetGLApi(this);

Powered by Google App Engine
This is Rietveld 408576698