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

Unified Diff: ui/ozone/platform/x11/gl_surface_glx_ozone.cc

Issue 1723303002: Implement GLX for Ozone X11. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change to use #define Created 4 years, 3 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 | « ui/ozone/platform/x11/gl_surface_glx_ozone.h ('k') | ui/ozone/platform/x11/ozone_platform_x11.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/x11/gl_surface_glx_ozone.cc
diff --git a/ui/ozone/platform/x11/gl_surface_glx_ozone.cc b/ui/ozone/platform/x11/gl_surface_glx_ozone.cc
new file mode 100644
index 0000000000000000000000000000000000000000..74ad75f9fbd99281fc21558b11acdecbb8b71367
--- /dev/null
+++ b/ui/ozone/platform/x11/gl_surface_glx_ozone.cc
@@ -0,0 +1,41 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/ozone/platform/x11/gl_surface_glx_ozone.h"
+
+#include <X11/Xlib.h>
+
+namespace ui {
+
+GLSurfaceGLXOzone::GLSurfaceGLXOzone(gfx::AcceleratedWidget window)
+ : NativeViewGLSurfaceGLX(window) {}
+
+GLSurfaceGLXOzone::~GLSurfaceGLXOzone() {
+ Destroy();
+}
+
+void GLSurfaceGLXOzone::RegisterEvents() {
+ auto* event_source = X11EventSourceLibevent::GetInstance();
+ // Can be null in tests, when we don't care about Exposes.
+ if (event_source) {
+ XSelectInput(gfx::GetXDisplay(), window(), ExposureMask);
+ event_source->AddXEventDispatcher(this);
+ }
+}
+
+void GLSurfaceGLXOzone::UnregisterEvents() {
+ auto* event_source = X11EventSourceLibevent::GetInstance();
+ if (event_source)
+ event_source->RemoveXEventDispatcher(this);
+}
+
+bool GLSurfaceGLXOzone::DispatchXEvent(XEvent* event) {
+ if (!CanHandleEvent(event))
+ return false;
+
+ ForwardExposeEvent(event);
+ return true;
+}
+
+} // namespace ui
« no previous file with comments | « ui/ozone/platform/x11/gl_surface_glx_ozone.h ('k') | ui/ozone/platform/x11/ozone_platform_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698