Index: gpu/command_buffer/service/gles2_cmd_decoder.cc |
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc |
index eef54c324159487ffae38b7f395953bfe4d82798..1608be0877bfe3fdc0df4c3df88bf16c07e3add4 100644 |
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc |
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc |
@@ -15,6 +15,7 @@ |
#include "base/atomicops.h" |
#include "base/at_exit.h" |
#include "base/callback.h" |
+#include "base/logging.h" |
#include "base/memory/scoped_ptr.h" |
#include "base/memory/weak_ptr.h" |
#include "build/build_config.h" |
@@ -40,6 +41,19 @@ |
#include "ui/gfx/gl/gl_implementation.h" |
#include "ui/gfx/gl/gl_surface.h" |
+#if defined(USE_X11) |
+#define Status int |
+ |
+#include "ui/base/x/x11_util.h" |
+#include "ui/base/x/x11_util_internal.h" |
+#include "ui/gfx/gl/gl_surface_glx.h" |
+#define CHECK_X_ERROR() do { \ |
Ami GONE FROM CHROMIUM
2011/09/14 23:23:11
Why not put this in the x11_util_internal.h header
|
+ CHECK(!ui::GetLastX11Error(gfx::GLSurfaceGLX::GetDisplay())); \ |
Ami GONE FROM CHROMIUM
2011/09/14 23:23:11
Can this be simplified by calling XGetDisplay() (i
Ami GONE FROM CHROMIUM
2011/09/14 23:23:11
In fact since this is the only use, you might redu
|
+ } while(0) |
+#else // USE_X11 |
+#define CHECK_X_ERROR() void(0) |
+#endif // USE_X11 |
+ |
#if !defined(GL_DEPTH24_STENCIL8) |
#define GL_DEPTH24_STENCIL8 0x88F0 |
#endif |
@@ -1730,6 +1744,8 @@ bool GLES2DecoderImpl::Initialize( |
// Take ownership of the GLContext. |
context_ = context; |
+ CHECK_X_ERROR(); |
+ |
if (!MakeCurrent()) { |
LOG(ERROR) << "GLES2DecoderImpl::Initialize failed because " |
<< "MakeCurrent failed."; |
@@ -1744,6 +1760,7 @@ bool GLES2DecoderImpl::Initialize( |
return false; |
} |
+ CHECK_X_ERROR(); |
CHECK_GL_ERROR(); |
disallowed_extensions_ = disallowed_extensions; |