gl_surface_glx_x11.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. #ifndef UI_GL_GL_SURFACE_GLX_X11_H_
  5. #define UI_GL_GL_SURFACE_GLX_X11_H_
  6. #include "ui/gfx/native_widget_types.h"
  7. #include "ui/gfx/x/connection.h"
  8. #include "ui/gfx/x/event.h"
  9. #include "ui/gl/gl_export.h"
  10. #include "ui/gl/gl_surface_glx.h"
  11. namespace gl {
  12. // X11 specific implementation of GLX surface. Registers as a
  13. // PlatformEventDispatcher to handle XEvents.
  14. class GL_EXPORT GLSurfaceGLXX11 : public NativeViewGLSurfaceGLX,
  15. public x11::EventObserver {
  16. public:
  17. explicit GLSurfaceGLXX11(gfx::AcceleratedWidget window);
  18. GLSurfaceGLXX11(const GLSurfaceGLXX11&) = delete;
  19. GLSurfaceGLXX11& operator=(const GLSurfaceGLXX11&) = delete;
  20. protected:
  21. ~GLSurfaceGLXX11() override;
  22. // NativeViewGLSurfaceGLX:
  23. void RegisterEvents() override;
  24. void UnregisterEvents() override;
  25. // x11::EventObserver:
  26. void OnEvent(const x11::Event& event) override;
  27. };
  28. } // namespace gl
  29. #endif // UI_GL_GL_SURFACE_GLX_X11_H_