OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 COMPONENTS_EXO_WAYLAND_CLIENTS_CLIENT_BASE_H_ | 5 #ifndef COMPONENTS_EXO_WAYLAND_CLIENTS_CLIENT_BASE_H_ |
6 #define COMPONENTS_EXO_WAYLAND_CLIENTS_CLIENT_BASE_H_ | 6 #define COMPONENTS_EXO_WAYLAND_CLIENTS_CLIENT_BASE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 25 matching lines...) Expand all Loading... |
36 std::string title = "Wayland Client"; | 36 std::string title = "Wayland Client"; |
37 size_t num_buffers = 8; | 37 size_t num_buffers = 8; |
38 size_t width = 256; | 38 size_t width = 256; |
39 size_t height = 256; | 39 size_t height = 256; |
40 int scale = 1; | 40 int scale = 1; |
41 bool fullscreen = false; | 41 bool fullscreen = false; |
42 bool transparent_background = false; | 42 bool transparent_background = false; |
43 bool use_drm = false; | 43 bool use_drm = false; |
44 std::string use_drm_value; | 44 std::string use_drm_value; |
45 int32_t drm_format = 0; | 45 int32_t drm_format = 0; |
| 46 bool immed = false; |
46 }; | 47 }; |
47 | 48 |
48 struct Globals { | 49 struct Globals { |
49 Globals(); | 50 Globals(); |
50 ~Globals(); | 51 ~Globals(); |
51 | 52 |
52 std::unique_ptr<wl_compositor> compositor; | 53 std::unique_ptr<wl_compositor> compositor; |
53 std::unique_ptr<wl_shm> shm; | 54 std::unique_ptr<wl_shm> shm; |
54 std::unique_ptr<wp_presentation> presentation; | 55 std::unique_ptr<wp_presentation> presentation; |
55 std::unique_ptr<zwp_linux_dmabuf_v1> linux_dmabuf; | 56 std::unique_ptr<zwp_linux_dmabuf_v1> linux_dmabuf; |
(...skipping 23 matching lines...) Expand all Loading... |
79 | 80 |
80 protected: | 81 protected: |
81 ClientBase(); | 82 ClientBase(); |
82 virtual ~ClientBase(); | 83 virtual ~ClientBase(); |
83 | 84 |
84 size_t width_ = 256; | 85 size_t width_ = 256; |
85 size_t height_ = 256; | 86 size_t height_ = 256; |
86 int scale_ = 1; | 87 int scale_ = 1; |
87 bool fullscreen_ = false; | 88 bool fullscreen_ = false; |
88 bool transparent_background_ = false; | 89 bool transparent_background_ = false; |
| 90 bool immed_ = false; |
89 | 91 |
90 std::unique_ptr<wl_display> display_; | 92 std::unique_ptr<wl_display> display_; |
91 std::unique_ptr<wl_surface> surface_; | 93 std::unique_ptr<wl_surface> surface_; |
92 std::unique_ptr<wl_shell_surface> shell_surface_; | 94 std::unique_ptr<wl_shell_surface> shell_surface_; |
93 Globals globals_; | 95 Globals globals_; |
94 #if defined(OZONE_PLATFORM_GBM) | 96 #if defined(OZONE_PLATFORM_GBM) |
95 base::ScopedFD drm_fd_; | 97 base::ScopedFD drm_fd_; |
96 std::unique_ptr<gbm_device> device_; | 98 std::unique_ptr<gbm_device> device_; |
97 #endif | 99 #endif |
98 scoped_refptr<gl::GLSurface> gl_surface_; | 100 scoped_refptr<gl::GLSurface> gl_surface_; |
99 scoped_refptr<gl::GLContext> gl_context_; | 101 scoped_refptr<gl::GLContext> gl_context_; |
100 std::unique_ptr<ui::ScopedMakeCurrent> make_current_; | 102 std::unique_ptr<ui::ScopedMakeCurrent> make_current_; |
101 unsigned egl_sync_type_ = 0; | 103 unsigned egl_sync_type_ = 0; |
102 std::vector<std::unique_ptr<Buffer>> buffers_; | 104 std::vector<std::unique_ptr<Buffer>> buffers_; |
103 sk_sp<GrContext> gr_context_; | 105 sk_sp<GrContext> gr_context_; |
104 | 106 |
105 private: | 107 private: |
106 std::unique_ptr<Buffer> CreateBuffer(int32_t drm_format); | 108 std::unique_ptr<Buffer> CreateBuffer(int32_t drm_format); |
107 | 109 |
108 DISALLOW_COPY_AND_ASSIGN(ClientBase); | 110 DISALLOW_COPY_AND_ASSIGN(ClientBase); |
109 }; | 111 }; |
110 | 112 |
111 } // namespace clients | 113 } // namespace clients |
112 } // namespace wayland | 114 } // namespace wayland |
113 } // namespace exo | 115 } // namespace exo |
114 | 116 |
115 #endif // COMPONENTS_EXO_WAYLAND_CLIENTS_CLIENT_BASE_H_ | 117 #endif // COMPONENTS_EXO_WAYLAND_CLIENTS_CLIENT_BASE_H_ |
OLD | NEW |