Skip to content

Commit

Permalink
No longer holding the pointer to the InitialRender
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkae committed Sep 1, 2023
1 parent 63c6c73 commit c403e9c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 26 deletions.
3 changes: 0 additions & 3 deletions src/include/server/mir/default_server_configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ class GraphicBufferAllocator;
class Cursor;
class CursorImage;
class GLConfig;
class InitialRender;
}
namespace input
{
Expand Down Expand Up @@ -231,7 +230,6 @@ class DefaultServerConfiguration : public virtual ServerConfiguration
virtual std::shared_ptr<input::CursorImages> the_cursor_images();
std::shared_ptr<ObserverRegistrar<graphics::DisplayConfigurationObserver>>
the_display_configuration_observer_registrar();
virtual std::shared_ptr<graphics::InitialRender> the_initial_render(std::shared_ptr<graphics::Display> in_display);

/** @} */

Expand Down Expand Up @@ -389,7 +387,6 @@ class DefaultServerConfiguration : public virtual ServerConfiguration
CachedPtr<graphics::Cursor> cursor;
CachedPtr<graphics::CursorImage> default_cursor_image;
CachedPtr<input::CursorImages> cursor_images;
CachedPtr<graphics::InitialRender> initial_render;

CachedPtr<frontend::SessionAuthorizer> session_authorizer;
CachedPtr<renderer::RendererFactory> renderer_factory;
Expand Down
31 changes: 9 additions & 22 deletions src/server/graphics/default_configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,15 @@ mir::DefaultServerConfiguration::the_display()
std::move(displays),
*the_display_configuration_policy());

the_initial_render(multiplexed_display);
auto initial = multiplexed_display->create_initial_render();
if (initial)
{
for (auto const& renderable : initial->get_renderables())
{
the_input_scene()->add_input_visualization(renderable);
}
}

return multiplexed_display;
});
}
Expand Down Expand Up @@ -497,25 +505,4 @@ mir::DefaultServerConfiguration::the_display_configuration_observer()
{
return std::make_shared<mg::DisplayConfigurationObserverMultiplexer>(default_executor);
});
}

std::shared_ptr<mg::InitialRender>
mir::DefaultServerConfiguration::the_initial_render(std::shared_ptr<mg::Display> in_display)
{
// TODO: This got weird. It is basically a helper initialization function instead of a "the_xyz()" thingy
return initial_render(
[display = in_display, input_scene = the_input_scene()]
{
auto initial = display->create_initial_render();
if (initial)
{
for (auto const& renderable : initial->get_renderables())
{
input_scene->add_input_visualization(renderable);
}
}


return initial;
});
}
1 change: 0 additions & 1 deletion src/server/symbols.map
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,6 @@ MIR_SERVER_2.15 {
mir::shell::SurfaceStackWrapper::send_to_back*;
mir::shell::ShellWrapper::swap_z_order*;
mir::shell::ShellWrapper::send_to_back*;
mir::DefaultServerConfiguration::the_initial_render*;
};
local: *;
};

0 comments on commit c403e9c

Please sign in to comment.