Skip to content

Commit

Permalink
Removing some unnecessary scene plumbing
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkae committed Sep 1, 2023
1 parent c1a588c commit 5a80e07
Show file tree
Hide file tree
Showing 22 changed files with 18 additions and 68 deletions.
3 changes: 1 addition & 2 deletions include/platform/mir/graphics/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,7 @@ class DisplayPlatform : public std::enable_shared_from_this<DisplayPlatform>
std::shared_ptr<DisplayConfigurationPolicy> const& initial_conf_policy,
std::shared_ptr<GLConfig> const& gl_config,
std::shared_ptr<mir::options::Option> const& options,
std::shared_ptr<GraphicBufferAllocator> const& allocator,
std::shared_ptr<mir::input::Scene> const& scene) = 0;
std::shared_ptr<GraphicBufferAllocator> const& allocator) = 0;

static auto interface_for(std::shared_ptr<DisplayPlatform> platform)
-> std::shared_ptr<DisplayInterfaceProvider>
Expand Down
10 changes: 0 additions & 10 deletions src/miral/smooth_boot_support.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,6 @@ auto miral::SmoothBootSupport::operator=(miral::SmoothBootSupport const& other)

void miral::SmoothBootSupport::operator()(mir::Server &server) const
{
server.add_init_callback([&server]()
{
server.the_display()->for_each_display_sync_group([&server](mg::DisplaySyncGroup& group)
{
group.for_each_display_buffer([&server](mg::DisplayBuffer& db)
{
db.view_area();
});
});
});
server.add_configuration_option(
mo::smooth_boot_opt,
"When set, provides a transition from the previous screen to the compositor",
Expand Down
3 changes: 0 additions & 3 deletions src/platforms/gbm-kms/server/kms/display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ mgg::Display::Display(
std::shared_ptr<DisplayConfigurationPolicy> const& initial_conf_policy,
std::shared_ptr<DisplayReport> const& listener,
std::shared_ptr<graphics::GraphicBufferAllocator> const& allocator,
std::shared_ptr<input::Scene> const& scene,
bool smooth_transition)
: owner{std::move(parent)},
drm_fd{std::move(drm_fd)},
Expand All @@ -165,7 +164,6 @@ mgg::Display::Display(
dirty_configuration{false},
bypass_option(bypass_option),
allocator{allocator},
scene{scene},
smooth_transition{smooth_transition}
{
monitor.filter_by_subsystem_and_type("drm", "drm_minor");
Expand Down Expand Up @@ -468,7 +466,6 @@ void mgg::Display::configure_locked(
bounding_rect,
transformation,
allocator,
scene,
smooth_transition);

display_buffers_new.push_back(std::move(db));
Expand Down
6 changes: 0 additions & 6 deletions src/platforms/gbm-kms/server/kms/display.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@

namespace mir
{
namespace input
{
class Scene;
}

namespace graphics
{
Expand Down Expand Up @@ -76,7 +72,6 @@ class Display : public graphics::Display
std::shared_ptr<DisplayConfigurationPolicy> const& initial_conf_policy,
std::shared_ptr<DisplayReport> const& listener,
std::shared_ptr<graphics::GraphicBufferAllocator> const& allocator,
std::shared_ptr<input::Scene> const& scene,
bool smooth_boot);
~Display();

Expand Down Expand Up @@ -118,7 +113,6 @@ class Display : public graphics::Display
BypassOption bypass_option;
std::weak_ptr<Cursor> cursor;
std::shared_ptr<graphics::GraphicBufferAllocator> const& allocator;
std::shared_ptr<input::Scene> const& scene;
bool smooth_transition;
};

Expand Down
1 change: 0 additions & 1 deletion src/platforms/gbm-kms/server/kms/display_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ mgg::DisplayBuffer::DisplayBuffer(
geom::Rectangle const& area,
glm::mat2 const& transformation,
std::shared_ptr<graphics::GraphicBufferAllocator> const& allocator,
std::shared_ptr<input::Scene> const&,
bool smooth_transition)
: provider{std::move(provider)},
listener(listener),
Expand Down
1 change: 0 additions & 1 deletion src/platforms/gbm-kms/server/kms/display_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ class DisplayBuffer : public graphics::DisplayBuffer,
geometry::Rectangle const& area,
glm::mat2 const& transformation,
std::shared_ptr<graphics::GraphicBufferAllocator> const& allocator,
std::shared_ptr<input::Scene> const& scene,
bool smooth_transition);
~DisplayBuffer();

Expand Down
4 changes: 1 addition & 3 deletions src/platforms/gbm-kms/server/kms/platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,7 @@ mir::UniqueModulePtr<mg::Display> mgg::Platform::create_display(
std::shared_ptr<DisplayConfigurationPolicy> const& initial_conf_policy,
std::shared_ptr<GLConfig> const&,
std::shared_ptr<mir::options::Option> const& options,
std::shared_ptr<GraphicBufferAllocator> const& allocator,
std::shared_ptr<mir::input::Scene> const& scene)
std::shared_ptr<GraphicBufferAllocator> const& allocator)
{
auto smooth_boot = options->is_set(options::smooth_boot_opt)
&& options->get<bool>(options::smooth_boot_opt);
Expand All @@ -312,7 +311,6 @@ mir::UniqueModulePtr<mg::Display> mgg::Platform::create_display(
initial_conf_policy,
listener,
allocator,
scene,
smooth_boot);
}

Expand Down
3 changes: 1 addition & 2 deletions src/platforms/gbm-kms/server/kms/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ class Platform : public graphics::DisplayPlatform
std::shared_ptr<DisplayConfigurationPolicy> const& initial_conf_policy,
std::shared_ptr<GLConfig> const& gl_config,
std::shared_ptr<mir::options::Option> const& options,
std::shared_ptr<GraphicBufferAllocator> const& allocator,
std::shared_ptr<mir::input::Scene> const& scene) override;
std::shared_ptr<GraphicBufferAllocator> const& allocator) override;

std::shared_ptr<mir::udev::Context> udev;

Expand Down
3 changes: 1 addition & 2 deletions src/platforms/wayland/platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ mir::UniqueModulePtr<mg::Display> mgw::Platform::create_display(
std::shared_ptr<DisplayConfigurationPolicy> const&,
std::shared_ptr<GLConfig> const& gl_config,
std::shared_ptr<mir::options::Option> const&,
std::shared_ptr<GraphicBufferAllocator> const&,
std::shared_ptr<mir::input::Scene> const&)
std::shared_ptr<GraphicBufferAllocator> const&)
{
return mir::make_module_ptr<mgw::Display>(wl_display, gl_config, report);
}
Expand Down
3 changes: 1 addition & 2 deletions src/platforms/wayland/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ class Platform : public graphics::DisplayPlatform
std::shared_ptr<DisplayConfigurationPolicy> const& initial_conf_policy,
std::shared_ptr<GLConfig> const& gl_config,
std::shared_ptr<mir::options::Option> const& options,
std::shared_ptr<GraphicBufferAllocator> const& allocator,
std::shared_ptr<mir::input::Scene> const& scene) override;
std::shared_ptr<GraphicBufferAllocator> const& allocator) override;

protected:
auto interface_for() -> std::shared_ptr<DisplayInterfaceProvider> override;
Expand Down
3 changes: 1 addition & 2 deletions src/platforms/x11/graphics/platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@ mir::UniqueModulePtr<mg::Display> mgx::Platform::create_display(
std::shared_ptr<DisplayConfigurationPolicy> const& initial_conf_policy,
std::shared_ptr<GLConfig> const& /*gl_config*/,
std::shared_ptr<mir::options::Option> const& /*options*/,
std::shared_ptr<GraphicBufferAllocator> const& /*allocator*/,
std::shared_ptr<mir::input::Scene> const& /*scene*/)
std::shared_ptr<GraphicBufferAllocator> const& /*allocator*/)
{
return make_module_ptr<mgx::Display>(
std::dynamic_pointer_cast<Platform>(shared_from_this()),
Expand Down
3 changes: 1 addition & 2 deletions src/platforms/x11/graphics/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ class Platform : public graphics::DisplayPlatform
std::shared_ptr<DisplayConfigurationPolicy> const& initial_conf_policy,
std::shared_ptr<GLConfig> const& gl_config,
std::shared_ptr<mir::options::Option> const& options,
std::shared_ptr<GraphicBufferAllocator> const& allocator,
std::shared_ptr<mir::input::Scene> const& scene) -> UniqueModulePtr<graphics::Display> override;
std::shared_ptr<GraphicBufferAllocator> const& allocator) -> UniqueModulePtr<graphics::Display> override;

auto provider_for_window(xcb_window_t x_win) -> std::shared_ptr<DisplayInterfaceProvider>;
protected:
Expand Down
3 changes: 1 addition & 2 deletions src/server/graphics/default_configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,7 @@ mir::DefaultServerConfiguration::the_display()
the_display_configuration_policy(),
the_gl_config(),
the_options(),
the_buffer_allocator(),
nullptr));
the_buffer_allocator()));
}
auto multiplexed_display = std::make_shared<mg::MultiplexingDisplay>(
std::move(displays),
Expand Down
3 changes: 1 addition & 2 deletions tests/include/mir/test/doubles/null_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ class NullDisplayPlatform : public graphics::DisplayPlatform
std::shared_ptr<graphics::DisplayConfigurationPolicy> const&,
std::shared_ptr<graphics::GLConfig> const&,
std::shared_ptr<mir::options::Option> const&,
std::shared_ptr<graphics::GraphicBufferAllocator> const&,
std::shared_ptr<mir::input::Scene> const&) -> mir::UniqueModulePtr<graphics::Display> override
std::shared_ptr<graphics::GraphicBufferAllocator> const&) -> mir::UniqueModulePtr<graphics::Display> override
{
return mir::make_module_ptr<NullDisplay>();
}
Expand Down
5 changes: 2 additions & 3 deletions tests/mir_test_framework/platform_graphics_throw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,12 @@ class ExceptionThrowingPlatform : public mg::DisplayPlatform, public mg::Renderi
std::shared_ptr<mg::DisplayConfigurationPolicy> const& ptr,
std::shared_ptr<mg::GLConfig> const& shared_ptr,
std::shared_ptr<mir::options::Option> const& options,
std::shared_ptr<mg::GraphicBufferAllocator> const& allocator,
std::shared_ptr<mir::input::Scene> const& scene) override
std::shared_ptr<mg::GraphicBufferAllocator> const& allocator) override
{
if (should_throw.at(ExceptionLocation::at_create_display))
BOOST_THROW_EXCEPTION(std::runtime_error("Exception during create_display"));

return stub_display_platform->create_display(ptr, shared_ptr, options, allocator, scene);
return stub_display_platform->create_display(ptr, shared_ptr, options, allocator);
}

private:
Expand Down
3 changes: 1 addition & 2 deletions tests/mir_test_framework/stubbed_graphics_platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ mir::UniqueModulePtr<mg::Display> mtf::StubGraphicPlatform::create_display(
std::shared_ptr<mg::DisplayConfigurationPolicy> const&,
std::shared_ptr<mg::GLConfig> const&,
std::shared_ptr<mir::options::Option> const&,
std::shared_ptr<mir::graphics::GraphicBufferAllocator> const&,
std::shared_ptr<mir::input::Scene> const&)
std::shared_ptr<mir::graphics::GraphicBufferAllocator> const&)
{
if (display_preset)
{
Expand Down
3 changes: 1 addition & 2 deletions tests/mir_test_framework/stubbed_graphics_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ class StubGraphicPlatform :
std::shared_ptr<mir::graphics::DisplayConfigurationPolicy> const&,
std::shared_ptr<mir::graphics::GLConfig> const&,
std::shared_ptr<mir::options::Option> const&,
std::shared_ptr<mir::graphics::GraphicBufferAllocator> const&,
std::shared_ptr<mir::input::Scene> const&) override;
std::shared_ptr<mir::graphics::GraphicBufferAllocator> const&) override;

protected:
auto maybe_create_interface(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,6 @@ class MinimalServerEnvironment : private mir::DefaultServerConfiguration
return the_buffer_allocator();
}

auto input_scene() -> std::shared_ptr<mir::input::Scene>
{
return the_input_scene();
}

private:
std::thread main_loop_thread;
static char const* argv[];
Expand Down Expand Up @@ -215,8 +210,7 @@ auto test_display_construction(mir::graphics::DisplayPlatform& platform, Minimal
env.initial_display_configuration(),
env.gl_config(),
env.options(),
env.buffer_allocator(),
env.input_scene());
env.buffer_allocator());

std::cout << "Successfully created display" << std::endl;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include "mir/test/doubles/mock_gbm.h"
#include "mir/test/doubles/stub_gl_config.h"
#include "mir/test/doubles/stub_buffer_allocator.h"
#include "mir/test/doubles/stub_input_scene.h"
#include "mir_test_framework/udev_environment.h"
#include "mir/test/doubles/fake_renderable.h"
#include "mir/graphics/transformation.h"
Expand Down Expand Up @@ -186,7 +185,6 @@ TEST_F(MesaDisplayBufferTest, unrotated_view_area_is_untouched)
display_area,
identity,
std::make_shared<StubBufferAllocator>(),
std::make_shared<StubInputScene>(),
false);

EXPECT_EQ(display_area, db.view_area());
Expand All @@ -211,7 +209,6 @@ TEST_F(MesaDisplayBufferTest, frames_requiring_gl_are_not_throttled)
display_area,
identity,
std::make_shared<StubBufferAllocator>(),
std::make_shared<StubInputScene>(),
false);

for (int frame = 0; frame < 5; ++frame)
Expand All @@ -235,7 +232,6 @@ TEST_F(MesaDisplayBufferTest, untransformed_with_bypassable_list_can_bypass)
display_area,
identity,
std::make_shared<StubBufferAllocator>(),
std::make_shared<StubInputScene>(),
false);

EXPECT_TRUE(db.overlay(bypassable_list));
Expand Down Expand Up @@ -263,7 +259,6 @@ TEST_F(MesaDisplayBufferTest, transformation_not_implemented_internally)
display_area,
rotate_left,
std::make_shared<StubBufferAllocator>(),
std::make_shared<StubInputScene>(),
false);

EXPECT_EQ(rotate_left, db.transformation());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@ class MesaDisplayConfigurationTest : public ::testing::Test
std::make_shared<mg::CloneDisplayConfigurationPolicy>(),
std::make_shared<mtd::StubGLConfig>(),
std::make_shared<mir::options::ProgramOption>(),
std::make_shared<mtd::StubBufferAllocator>(),
std::make_shared<mtd::StubInputScene>());
std::make_shared<mtd::StubBufferAllocator>());
}

void setup_sample_modes()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ class DisplayTestGeneric : public ::testing::Test
std::make_shared<mg::CloneDisplayConfigurationPolicy>(),
std::make_shared<mtd::StubGLConfig>(),
std::make_shared<mir::options::ProgramOption>(),
std::make_shared<mtd::StubBufferAllocator>(),
std::make_shared<mtd::StubInputScene>());
std::make_shared<mtd::StubBufferAllocator>());
}

::testing::NiceMock<mtd::MockEGL> mock_egl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include "mir/graphics/display_configuration_policy.h"
#include "mir/test/doubles/stub_gl_config.h"
#include "mir/test/doubles/stub_buffer_allocator.h"
#include "mir/test/doubles/stub_input_scene.h"

#include "mir_test_framework/udev_environment.h"

Expand Down Expand Up @@ -171,8 +170,7 @@ class MesaDisplayMultiMonitorTest : public ::testing::Test
std::make_shared<ClonedDisplayConfigurationPolicy>(),
std::make_shared<mtd::StubGLConfig>(),
std::make_shared<mir::options::ProgramOption>(),
std::make_shared<mtd::StubBufferAllocator>(),
std::make_shared<mtd::StubInputScene>());
std::make_shared<mtd::StubBufferAllocator>());
}

std::shared_ptr<mg::Display> create_display_side_by_side(
Expand All @@ -182,8 +180,7 @@ class MesaDisplayMultiMonitorTest : public ::testing::Test
std::make_shared<SideBySideDisplayConfigurationPolicy>(),
std::make_shared<mtd::StubGLConfig>(),
std::make_shared<mir::options::ProgramOption>(),
std::make_shared<mtd::StubBufferAllocator>(),
std::make_shared<mtd::StubInputScene>());
std::make_shared<mtd::StubBufferAllocator>());
}

void setup_outputs(int connected, int disconnected)
Expand Down

0 comments on commit 5a80e07

Please sign in to comment.