diff options
author | jbauman@chromium.org <jbauman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-06 17:50:10 +0000 |
---|---|---|
committer | jbauman@chromium.org <jbauman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-06 17:50:10 +0000 |
commit | bf6e49929346d26e06485532d3d58b7143c10044 (patch) | |
tree | dfc926289696ab12e71dc23f06848d3b185c8ff2 /ui | |
parent | 1170614ecd12db83367689799de0d57c6a8577ae (diff) | |
download | chromium_src-bf6e49929346d26e06485532d3d58b7143c10044.zip chromium_src-bf6e49929346d26e06485532d3d58b7143c10044.tar.gz chromium_src-bf6e49929346d26e06485532d3d58b7143c10044.tar.bz2 |
ANGLE has to check for lost device whenever it switches to a context, which can be pretty slow. To avoid this, don't try to switch to the currently-bound egl context.
BUG=
TEST=JSGameBench
Review URL: http://codereview.chromium.org/6720041
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80652 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r-- | ui/gfx/gl/gl_context_egl.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ui/gfx/gl/gl_context_egl.cc b/ui/gfx/gl/gl_context_egl.cc index 2b1565f..967329d 100644 --- a/ui/gfx/gl/gl_context_egl.cc +++ b/ui/gfx/gl/gl_context_egl.cc @@ -233,6 +233,8 @@ void NativeViewEGLContext::Destroy() { bool NativeViewEGLContext::MakeCurrent() { DCHECK(context_); + if (context_ == eglGetCurrentContext()) + return true; if (!eglMakeCurrent(g_display, surface_->egl_surface(), surface_->egl_surface(), @@ -381,6 +383,8 @@ void SecondaryEGLContext::Destroy() { bool SecondaryEGLContext::MakeCurrent() { DCHECK(context_); + if (context_ == eglGetCurrentContext()) + return true; if (!eglMakeCurrent(g_display, surface_->egl_surface(), surface_->egl_surface(), |