Commit 3268c758 authored by reveman's avatar reveman Committed by Commit bot

exo: Avoid creating GLContext in motion event client unless needed.

Always creating a GL context is currently preventing this client
from being used when GL is not available.

BUG=
TEST=wayland_motion_events (without GL)

Review-Url: https://codereview.chromium.org/2566863002
Cr-Commit-Position: refs/heads/master@{#437793}
parent f19968ed
......@@ -370,16 +370,6 @@ int MotionEvents::Run() {
return 1;
}
bool gl_initialized = gl::init::InitializeGLOneOff();
DCHECK(gl_initialized);
gl_surface_ = gl::init::CreateOffscreenGLSurface(gfx::Size());
gl_context_ =
gl::init::CreateGLContext(nullptr, // share_group
gl_surface_.get(), gl::GLContextAttribs());
make_current_.reset(
new ui::ScopedMakeCurrent(gl_context_.get(), gl_surface_.get()));
wl_registry_listener registry_listener = {RegistryHandler, RegistryRemover};
wl_registry* registry = wl_display_get_registry(display_.get());
......@@ -446,6 +436,16 @@ int MotionEvents::Run() {
return 1;
}
bool gl_initialized = gl::init::InitializeGLOneOff();
DCHECK(gl_initialized);
gl_surface_ = gl::init::CreateOffscreenGLSurface(gfx::Size());
gl_context_ =
gl::init::CreateGLContext(nullptr, // share_group
gl_surface_.get(), gl::GLContextAttribs());
make_current_.reset(
new ui::ScopedMakeCurrent(gl_context_.get(), gl_surface_.get()));
if (gl::GLSurfaceEGL::HasEGLExtension("EGL_EXT_image_flush_external") ||
gl::GLSurfaceEGL::HasEGLExtension("EGL_ARM_implicit_external_sync")) {
egl_sync_type = EGL_SYNC_FENCE_KHR;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment