summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorepenner@chromium.org <epenner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-28 14:43:50 +0000
committerepenner@chromium.org <epenner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-28 14:43:50 +0000
commit04a1be362096c6e1565e363ec599d5013fd63fd8 (patch)
tree12414e94f370296f28a93a1fcc2d22d6ff41a681 /ui
parentbcf60feab123cdb2f02a2b5ba4cdc949b220e98b (diff)
downloadchromium_src-04a1be362096c6e1565e363ec599d5013fd63fd8.zip
chromium_src-04a1be362096c6e1565e363ec599d5013fd63fd8.tar.gz
chromium_src-04a1be362096c6e1565e363ec599d5013fd63fd8.tar.bz2
Reland "GPU: Reduce MakeCurrent calls to fix Orange San Diego""
This patch now also always calls MakeVirtuallyCurrent during initialize and MakeCurrent, such that the next context will always restore. The context state is restored only if the API has changed or the virtually current context has changed, so we should never skip calling MakeVirtuallyCurrent. BUG=241188 Review URL: https://chromiumcodereview.appspot.com/15841002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202561 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/gl/gl_gl_api_implementation.cc3
-rw-r--r--ui/gl/gl_state_restorer.h1
2 files changed, 3 insertions, 1 deletions
diff --git a/ui/gl/gl_gl_api_implementation.cc b/ui/gl/gl_gl_api_implementation.cc
index 1002dbd..a8f671e 100644
--- a/ui/gl/gl_gl_api_implementation.cc
+++ b/ui/gl/gl_gl_api_implementation.cc
@@ -285,7 +285,8 @@ bool VirtualGLApi::MakeCurrent(GLContext* virtual_context, GLSurface* surface) {
// needed for individual GL calls.
GLApi* temp = GetCurrentGLApi();
SetGLToRealGLApi();
- virtual_context->GetGLStateRestorer()->RestoreState();
+ if (virtual_context->GetGLStateRestorer()->IsInitialized())
+ virtual_context->GetGLStateRestorer()->RestoreState();
SetGLApi(temp);
}
SetGLApi(this);
diff --git a/ui/gl/gl_state_restorer.h b/ui/gl/gl_state_restorer.h
index 3ada2fe..6d8791f 100644
--- a/ui/gl/gl_state_restorer.h
+++ b/ui/gl/gl_state_restorer.h
@@ -17,6 +17,7 @@ class GL_EXPORT GLStateRestorer {
GLStateRestorer();
virtual ~GLStateRestorer();
+ virtual bool IsInitialized() = 0;
virtual void RestoreState() = 0;
virtual void RestoreAllTextureUnitBindings() = 0;
virtual void RestoreFramebufferBindings() = 0;