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

Unified Diff: components/exo/wayland/clients/motion_events.cc

Issue 2566863002: exo: Avoid creating GLContext in motion event client unless needed. (Closed)
Patch Set: Created 4 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/wayland/clients/motion_events.cc
diff --git a/components/exo/wayland/clients/motion_events.cc b/components/exo/wayland/clients/motion_events.cc
index 19b24b2cd3a90d0db6275e088ea4400ac8018101..8a4fab4b722e0e4dd9cffa55833dd0dc7c981c0b 100644
--- a/components/exo/wayland/clients/motion_events.cc
+++ b/components/exo/wayland/clients/motion_events.cc
@@ -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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698