summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorbacker@chromium.org <backer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-17 13:22:01 +0000
committerbacker@chromium.org <backer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-17 13:22:01 +0000
commite4f9f9bd81b6dc2ca82f5b8913f3a49c616c1dda (patch)
tree5868ab46e38cb7a66856f2b8c0e50847733d2620 /ui
parent53cf9fc03466a57d403c8cd5869881b7d6aa3583 (diff)
downloadchromium_src-e4f9f9bd81b6dc2ca82f5b8913f3a49c616c1dda.zip
chromium_src-e4f9f9bd81b6dc2ca82f5b8913f3a49c616c1dda.tar.gz
chromium_src-e4f9f9bd81b6dc2ca82f5b8913f3a49c616c1dda.tar.bz2
Check for extensions in order to fail early.
Currently, we're not checking for extensions on EGL path and we're only checking for XComposite extensions browser side. This change checks for extensions early and to fail at context creation (technically GLES2Decoder) creation time. BUG=none TEST=on hardware supporting the extensions Review URL: http://codereview.chromium.org/8293004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105797 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/gfx/gl/gl_context_cgl.cc6
-rw-r--r--ui/gfx/gl/gl_context_egl.cc6
-rw-r--r--ui/gfx/gl/gl_context_glx.cc6
-rw-r--r--ui/gfx/gl/gl_context_osmesa.cc6
-rw-r--r--ui/gfx/gl/gl_context_wgl.cc6
-rw-r--r--ui/gfx/gl/gl_surface.cc3
-rw-r--r--ui/gfx/gl/gl_surface.h5
7 files changed, 30 insertions, 8 deletions
diff --git a/ui/gfx/gl/gl_context_cgl.cc b/ui/gfx/gl/gl_context_cgl.cc
index a759793..86933b64 100644
--- a/ui/gfx/gl/gl_context_cgl.cc
+++ b/ui/gfx/gl/gl_context_cgl.cc
@@ -101,7 +101,11 @@ bool GLContextCGL::MakeCurrent(GLSurface* surface) {
}
SetCurrent(this, surface);
- surface->OnMakeCurrent(this);
+ if (!surface->OnMakeCurrent(this)) {
+ LOG(ERROR) << "Unable to make gl context current.";
+ return false;
+ }
+
return true;
}
diff --git a/ui/gfx/gl/gl_context_egl.cc b/ui/gfx/gl/gl_context_egl.cc
index dea684b..ffaaaea 100644
--- a/ui/gfx/gl/gl_context_egl.cc
+++ b/ui/gfx/gl/gl_context_egl.cc
@@ -97,7 +97,11 @@ bool GLContextEGL::MakeCurrent(GLSurface* surface) {
}
SetCurrent(this, surface);
- surface->OnMakeCurrent(this);
+ if (!surface->OnMakeCurrent(this)) {
+ LOG(ERROR) << "Could not make current.";
+ return false;
+ }
+
return true;
}
diff --git a/ui/gfx/gl/gl_context_glx.cc b/ui/gfx/gl/gl_context_glx.cc
index 071107a..0797721 100644
--- a/ui/gfx/gl/gl_context_glx.cc
+++ b/ui/gfx/gl/gl_context_glx.cc
@@ -177,7 +177,11 @@ bool GLContextGLX::MakeCurrent(GLSurface* surface) {
}
SetCurrent(this, surface);
- surface->OnMakeCurrent(this);
+ if (!surface->OnMakeCurrent(this)) {
+ LOG(ERROR) << "Could not make current.";
+ return false;
+ }
+
return true;
}
diff --git a/ui/gfx/gl/gl_context_osmesa.cc b/ui/gfx/gl/gl_context_osmesa.cc
index 6b56f9d..3af14ae 100644
--- a/ui/gfx/gl/gl_context_osmesa.cc
+++ b/ui/gfx/gl/gl_context_osmesa.cc
@@ -70,7 +70,11 @@ bool GLContextOSMesa::MakeCurrent(GLSurface* surface) {
OSMesaPixelStore(OSMESA_Y_UP, 0);
SetCurrent(this, surface);
- surface->OnMakeCurrent(this);
+ if (!surface->OnMakeCurrent(this)) {
+ LOG(ERROR) << "Could not make current.";
+ return false;
+ }
+
return true;
}
diff --git a/ui/gfx/gl/gl_context_wgl.cc b/ui/gfx/gl/gl_context_wgl.cc
index bf44450..dc75b78 100644
--- a/ui/gfx/gl/gl_context_wgl.cc
+++ b/ui/gfx/gl/gl_context_wgl.cc
@@ -84,7 +84,11 @@ bool GLContextWGL::MakeCurrent(GLSurface* surface) {
}
SetCurrent(this, surface);
- surface->OnMakeCurrent(this);
+ if (!surface->OnMakeCurrent(this)) {
+ LOG(ERROR) << "Could not make current.";
+ return false;
+ }
+
return true;
}
diff --git a/ui/gfx/gl/gl_surface.cc b/ui/gfx/gl/gl_surface.cc
index a47ab98..868b1b29 100644
--- a/ui/gfx/gl/gl_surface.cc
+++ b/ui/gfx/gl/gl_surface.cc
@@ -28,7 +28,8 @@ unsigned int GLSurface::GetBackingFrameBufferObject() {
return 0;
}
-void GLSurface::OnMakeCurrent(GLContext* context) {
+bool GLSurface::OnMakeCurrent(GLContext* context) {
+ return true;
}
void GLSurface::SetVisible(bool visible) {
diff --git a/ui/gfx/gl/gl_surface.h b/ui/gfx/gl/gl_surface.h
index a1f4584..60e32c4 100644
--- a/ui/gfx/gl/gl_surface.h
+++ b/ui/gfx/gl/gl_surface.h
@@ -50,8 +50,9 @@ class GL_EXPORT GLSurface : public base::RefCounted<GLSurface> {
static bool InitializeOneOff();
- // Called after a context is made current with this surface.
- virtual void OnMakeCurrent(GLContext* context);
+ // Called after a context is made current with this surface. Returns false
+ // on error.
+ virtual bool OnMakeCurrent(GLContext* context);
virtual void SetVisible(bool visible);