OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_GL_GL_SURFACE_EGL_X11_H_ | 5 #ifndef UI_GL_GL_SURFACE_EGL_X11_H_ |
6 #define UI_GL_GL_SURFACE_EGL_X11_H_ | 6 #define UI_GL_GL_SURFACE_EGL_X11_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "ui/events/platform/platform_event_dispatcher.h" | 13 #include "ui/events/platform/platform_event_dispatcher.h" |
14 #include "ui/gl/gl_export.h" | 14 #include "ui/gl/gl_export.h" |
15 #include "ui/gl/gl_surface_egl.h" | 15 #include "ui/gl/gl_surface_egl.h" |
16 | 16 |
17 namespace gfx { | 17 namespace gl { |
18 | 18 |
19 // Encapsulates an EGL surface bound to a view using the X Window System. | 19 // Encapsulates an EGL surface bound to a view using the X Window System. |
20 class GL_EXPORT NativeViewGLSurfaceEGLX11 : public NativeViewGLSurfaceEGL, | 20 class GL_EXPORT NativeViewGLSurfaceEGLX11 : public NativeViewGLSurfaceEGL, |
21 public ui::PlatformEventDispatcher { | 21 public ui::PlatformEventDispatcher { |
22 public: | 22 public: |
23 explicit NativeViewGLSurfaceEGLX11(EGLNativeWindowType window); | 23 explicit NativeViewGLSurfaceEGLX11(EGLNativeWindowType window); |
24 | 24 |
25 // NativeViewGLSurfaceEGL overrides. | 25 // NativeViewGLSurfaceEGL overrides. |
26 EGLConfig GetConfig() override; | 26 EGLConfig GetConfig() override; |
27 void Destroy() override; | 27 void Destroy() override; |
28 bool Resize(const gfx::Size& size, | 28 bool Resize(const gfx::Size& size, |
29 float scale_factor, | 29 float scale_factor, |
30 bool has_alpha) override; | 30 bool has_alpha) override; |
31 bool InitializeNativeWindow() override; | 31 bool InitializeNativeWindow() override; |
32 | 32 |
33 private: | 33 private: |
34 ~NativeViewGLSurfaceEGLX11() override; | 34 ~NativeViewGLSurfaceEGLX11() override; |
35 | 35 |
36 EGLNativeWindowType parent_window_; | 36 EGLNativeWindowType parent_window_; |
37 | 37 |
38 // PlatformEventDispatcher implementation. | 38 // PlatformEventDispatcher implementation. |
39 bool CanDispatchEvent(const ui::PlatformEvent& event) override; | 39 bool CanDispatchEvent(const ui::PlatformEvent& event) override; |
40 uint32_t DispatchEvent(const ui::PlatformEvent& event) override; | 40 uint32_t DispatchEvent(const ui::PlatformEvent& event) override; |
41 | 41 |
42 DISALLOW_COPY_AND_ASSIGN(NativeViewGLSurfaceEGLX11); | 42 DISALLOW_COPY_AND_ASSIGN(NativeViewGLSurfaceEGLX11); |
43 }; | 43 }; |
44 | 44 |
45 } // namespace gfx | 45 } // namespace gl |
46 | 46 |
47 #endif // UI_GL_GL_SURFACE_EGL_X11_H_ | 47 #endif // UI_GL_GL_SURFACE_EGL_X11_H_ |
OLD | NEW |