summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authoramarinichev@chromium.org <amarinichev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-13 17:57:54 +0000
committeramarinichev@chromium.org <amarinichev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-13 17:57:54 +0000
commit0fc357452454dbcf342314dfa828bdcb2dd560be (patch)
tree3975361c7255264d9a320e9c9eb04db3f67e2796 /ui
parent1afd94be24f99ee691828772c02256bd1c9fdc87 (diff)
downloadchromium_src-0fc357452454dbcf342314dfa828bdcb2dd560be.zip
chromium_src-0fc357452454dbcf342314dfa828bdcb2dd560be.tar.gz
chromium_src-0fc357452454dbcf342314dfa828bdcb2dd560be.tar.bz2
Adds GLContext::LosesAllContextsOnContextLost.
GLContext::LosesAllContextsOnContextLost specifies whether or not all contexts need to be destroyed when recovering from lost context condition. GpuCommandBufferStub::OnFlush and GpuCommandBufferStub::OnAsyncFlush will instruct soon-to-be-renamed GpuRenderThread to close all channels when the context is lost and LosesAllContextsOnContextLost returns true. From the EGL 1.4 spec: "...On detection of this error, the application must destroy all contexts (by calling eglDestroyContext for each context). To continue rendering the application must recreate any contexts it requires, and subsequently restore any client API state and objects it wishes to use." However even with this change Angle still doesn't recover correctly. BUG=76753 TEST=breakpoint on eglDestroyContext Review URL: http://codereview.chromium.org/6813010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81437 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/gfx/gl/gl_context.cc17
-rw-r--r--ui/gfx/gl/gl_context.h2
2 files changed, 19 insertions, 0 deletions
diff --git a/ui/gfx/gl/gl_context.cc b/ui/gfx/gl/gl_context.cc
index 769f28c..847c9bb 100644
--- a/ui/gfx/gl/gl_context.cc
+++ b/ui/gfx/gl/gl_context.cc
@@ -55,4 +55,21 @@ bool GLContext::InitializeCommon() {
return true;
}
+bool GLContext::LosesAllContextsOnContextLost()
+{
+ switch (GetGLImplementation()) {
+ case kGLImplementationDesktopGL:
+ return false;
+ case kGLImplementationEGLGLES2:
+ return true;
+ case kGLImplementationOSMesaGL:
+ return false;
+ case kGLImplementationMockGL:
+ return false;
+ default:
+ NOTREACHED();
+ return true;
+ }
+}
+
} // namespace gfx
diff --git a/ui/gfx/gl/gl_context.h b/ui/gfx/gl/gl_context.h
index 67bba0b..f39a77a 100644
--- a/ui/gfx/gl/gl_context.h
+++ b/ui/gfx/gl/gl_context.h
@@ -70,6 +70,8 @@ class GLContext {
// OpenGL context shares textures and other resources.
static GLContext* CreateOffscreenGLContext(GLContext* shared_context);
+ static bool LosesAllContextsOnContextLost();
+
protected:
bool InitializeCommon();