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

Side by Side Diff: ui/gl/gl_surface_glx_x11.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
« no previous file with comments | « ui/gl/gl_surface_glx_x11.h ('k') | ui/gl/init/gl_factory_x11.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/gl/gl_surface_glx_x11.h"
6
7 #include <X11/Xlib.h>
8
9 #include "ui/events/platform/platform_event_source.h"
10 #include "ui/gfx/x/x11_types.h"
11
12 namespace gl {
13
14 GLSurfaceGLXX11::GLSurfaceGLXX11(gfx::AcceleratedWidget window)
15 : NativeViewGLSurfaceGLX(window) {}
16
17 GLSurfaceGLXX11::~GLSurfaceGLXX11() {
18 Destroy();
19 }
20
21 void GLSurfaceGLXX11::RegisterEvents() {
22 auto* event_source = ui::PlatformEventSource::GetInstance();
23 // Can be null in tests, when we don't care about Exposes.
24 if (event_source) {
25 XSelectInput(gfx::GetXDisplay(), window(), ExposureMask);
26 event_source->AddPlatformEventDispatcher(this);
27 }
28 }
29
30 void GLSurfaceGLXX11::UnregisterEvents() {
31 auto* event_source = ui::PlatformEventSource::GetInstance();
32 if (event_source)
33 event_source->RemovePlatformEventDispatcher(this);
34 }
35
36 bool GLSurfaceGLXX11::CanDispatchEvent(const ui::PlatformEvent& event) {
37 return CanHandleEvent(event);
38 }
39
40 uint32_t GLSurfaceGLXX11::DispatchEvent(const ui::PlatformEvent& event) {
41 ForwardExposeEvent(event);
42 return ui::POST_DISPATCH_STOP_PROPAGATION;
43 }
44
45 } // namespace gl
OLDNEW
« no previous file with comments | « ui/gl/gl_surface_glx_x11.h ('k') | ui/gl/init/gl_factory_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698