summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/service/mailbox_synchronizer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gpu/command_buffer/service/mailbox_synchronizer.cc')
-rw-r--r--gpu/command_buffer/service/mailbox_synchronizer.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/gpu/command_buffer/service/mailbox_synchronizer.cc b/gpu/command_buffer/service/mailbox_synchronizer.cc
index 09a3f1d..0503fb1 100644
--- a/gpu/command_buffer/service/mailbox_synchronizer.cc
+++ b/gpu/command_buffer/service/mailbox_synchronizer.cc
@@ -7,6 +7,7 @@
#include "base/bind.h"
#include "gpu/command_buffer/service/mailbox_manager.h"
#include "gpu/command_buffer/service/texture_manager.h"
+#include "ui/gl/gl_implementation.h"
namespace gpu {
namespace gles2 {
@@ -20,6 +21,29 @@ MailboxSynchronizer* g_instance = NULL;
// static
bool MailboxSynchronizer::Initialize() {
DCHECK(!g_instance);
+ DCHECK(gfx::GetGLImplementation() != gfx::kGLImplementationNone)
+ << "GL bindings not initialized";
+ switch (gfx::GetGLImplementation()) {
+ case gfx::kGLImplementationMockGL:
+ break;
+ case gfx::kGLImplementationEGLGLES2:
+#if !defined(OS_MACOSX)
+ {
+ if (!gfx::g_driver_egl.ext.b_EGL_KHR_image_base ||
+ !gfx::g_driver_egl.ext.b_EGL_KHR_gl_texture_2D_image ||
+ !gfx::g_driver_gl.ext.b_GL_OES_EGL_image ||
+ !gfx::g_driver_egl.ext.b_EGL_KHR_fence_sync) {
+ LOG(WARNING) << "MailboxSync not supported due to missing EGL "
+ "image/fence support";
+ return false;
+ }
+ }
+ break;
+#endif
+ default:
+ NOTREACHED();
+ return false;
+ }
g_instance = new MailboxSynchronizer;
return true;
}