19 #ifndef MIR_GRAPHICS_NESTED_DISPLAY_H_
20 #define MIR_GRAPHICS_NESTED_DISPLAY_H_
32 #include <unordered_map>
38 class InputDispatcher;
49 class DisplayConfigurationPolicy;
61 explicit EGLSurfaceHandle(EGLDisplay display, EGLNativeWindowType native_window, EGLConfig cfg);
64 operator EGLSurface()
const {
return egl_surface; }
67 EGLDisplay
const egl_display;
68 EGLSurface
const egl_surface;
75 std::shared_ptr<GLConfig>
const& gl_config);
81 operator EGLDisplay()
const {
return egl_display; }
84 EGLDisplay egl_display;
85 EGLContext egl_context_;
86 std::shared_ptr<GLConfig>
const gl_config;
102 std::shared_ptr<detail::DisplayBuffer>
const output;
114 std::shared_ptr<Platform>
const& platform,
115 std::shared_ptr<HostConnection>
const& connection,
116 std::shared_ptr<input::InputDispatcher>
const& dispatcher,
117 std::shared_ptr<DisplayReport>
const& display_report,
118 std::shared_ptr<DisplayConfigurationPolicy>
const& conf_policy,
119 std::shared_ptr<GLConfig>
const& gl_config,
120 std::shared_ptr<input::CursorListener>
const& cursor_listener);
126 std::unique_ptr<DisplayConfiguration>
configuration()
const override;
138 void pause()
override;
141 std::shared_ptr<graphics::Cursor>
create_hardware_cursor(std::shared_ptr<CursorImage>
const& initial_image)
override;
145 std::shared_ptr<Platform>
const platform;
146 std::shared_ptr<HostConnection>
const connection;
147 std::shared_ptr<input::InputDispatcher>
const dispatcher;
148 std::shared_ptr<DisplayReport>
const display_report;
150 std::shared_ptr<input::CursorListener>
const cursor_listener;
152 std::mutex outputs_mutex;
153 std::unordered_map<DisplayConfigurationOutputId, std::shared_ptr<detail::DisplaySyncGroup>> outputs;
163 #endif // MIR_GRAPHICS_NESTED_DISPLAY_H_
~EGLDisplayHandle() noexcept
All things Mir.
Definition: atomic_callback.h:25
void for_each_display_sync_group(std::function< void(DisplaySyncGroup &)>const &f) override
Executes a functor for each output group.
void initialize(MirPixelFormat format)
void post() override
Post the content of the DisplayBuffers associated with this DisplaySyncGroup.
Interface to an output framebuffer.
Definition: display_buffer.h:47
void register_pause_resume_handlers(EventHandlerRegister &handlers, DisplayPauseHandler const &pause_handler, DisplayResumeHandler const &resume_handler) override
Registers handlers for pausing and resuming the display subsystem.
DisplaySyncGroup represents a group of displays that need to be output in unison as a single post() c...
Definition: display.h:54
EGLSurfaceHandle(EGLDisplay display, EGLNativeWindowType native_window, EGLConfig cfg)
Definition: host_connection.h:40
void for_each_display_buffer(std::function< void(graphics::DisplayBuffer &)> const &) override
void resume() override
Resumes the display.
Definition: display.h:110
std::function< bool()> DisplayResumeHandler
Definition: display.h:40
EGLContext egl_context() const
EGLint const nested_egl_context_attribs[]
std::unique_ptr< graphics::GLContext > create_gl_context() override
Creates a GLContext object that shares resources with the Display's GL context.
std::shared_ptr< graphics::Cursor > create_hardware_cursor(std::shared_ptr< CursorImage > const &initial_image) override
Create a hardware cursor object.
std::function< bool()> DisplayPauseHandler
Definition: display.h:37
void configure(DisplayConfiguration const &) override
Sets a new output configuration.
void pause() override
Pauses the display.
~EGLSurfaceHandle() noexcept
EGLConfig choose_windowed_es_config(MirPixelFormat format) const
std::chrono::milliseconds recommended_sleep() const override
Returns a recommendation to the compositor as to how long it should wait before sampling the scene fo...
DisplaySyncGroup()=default
void register_configuration_change_handler(EventHandlerRegister &handlers, DisplayConfigurationChangeHandler const &conf_change_handler) override
Registers a handler for display configuration changes.
std::unique_ptr< DisplayConfiguration > configuration() const override
Gets a copy of the current output configuration.
EGLDisplayHandle(EGLNativeDisplayType native_display, std::shared_ptr< GLConfig > const &gl_config)
Interface to the display subsystem.
Definition: display.h:87
std::function< void()> DisplayConfigurationChangeHandler
Definition: display.h:41
Interface to a configuration of display cards and outputs.
Definition: display_configuration.h:166
Definition: event_handler_register.h:31