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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ui/ozone/platform/x11/gl_surface_glx_ozone.h"
6
7 #include <X11/Xlib.h>
8
9 namespace ui {
10
11 GLSurfaceGLXOzone::GLSurfaceGLXOzone(gfx::AcceleratedWidget window)
12 : NativeViewGLSurfaceGLX(window) {}
13
14 GLSurfaceGLXOzone::~GLSurfaceGLXOzone() {
15 Destroy();
16 }
17
18 void GLSurfaceGLXOzone::RegisterEvents() {
19 auto* event_source = X11EventSourceLibevent::GetInstance();
20 // Can be null in tests, when we don't care about Exposes.
21 if (event_source) {
22 XSelectInput(gfx::GetXDisplay(), window(), ExposureMask);
23 event_source->AddXEventDispatcher(this);
24 }
25 }
26
27 void GLSurfaceGLXOzone::UnregisterEvents() {
28 auto* event_source = X11EventSourceLibevent::GetInstance();
29 if (event_source)
30 event_source->RemoveXEventDispatcher(this);
31 }
32
33 bool GLSurfaceGLXOzone::DispatchXEvent(XEvent* event) {
34 if (!CanHandleEvent(event))
35 return false;
36
37 ForwardExposeEvent(event);
38 return true;
39 }
40
41 } // namespace ui
OLDNEW
« 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