Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Unified Diff: gpu/command_buffer/service/mailbox_synchronizer.cc

Issue 196653019: gpu: Add extension check when initializing MailboxSync (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: and mac should fail Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « android_webview/lib/main/aw_main_delegate.cc ('k') | gpu/command_buffer/service/texture_definition.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/mailbox_synchronizer.cc
diff --git a/gpu/command_buffer/service/mailbox_synchronizer.cc b/gpu/command_buffer/service/mailbox_synchronizer.cc
index 09a3f1dcc9e189b114f9eec03bade77fa331ee39..0503fb12bdaba73f6b350633b301cfb91b170853 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;
}
« no previous file with comments | « android_webview/lib/main/aw_main_delegate.cc ('k') | gpu/command_buffer/service/texture_definition.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698