Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop the unnecessary indirection of mc::BufferStreamFactory #3368

Merged
merged 4 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include "mir/compositor/buffer_stream.h"
#include "mir/geometry/size.h"
#include "mir/synchronised.h"
#include "multi_monitor_arbiter.h"

#include <atomic>
#include <mutex>
Expand All @@ -31,6 +30,8 @@ namespace mir
{
namespace compositor
{
class MultiMonitorArbiter;

class Stream : public BufferStream
{
public:
Expand Down
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 @@ -44,7 +44,6 @@ class MultiplexingDispatchable;
}
namespace compositor
{
class BufferStreamFactory;
class Scene;
class DisplayBufferCompositorFactory;
class Compositor;
Expand Down Expand Up @@ -292,7 +291,6 @@ class DefaultServerConfiguration : public virtual ServerConfiguration
/** @name scene configuration - dependencies
* dependencies of scene on the rest of the Mir
* @{ */
virtual std::shared_ptr<scene::BufferStreamFactory> the_buffer_stream_factory();
virtual std::shared_ptr<scene::SceneReport> the_scene_report();
/** @} */

Expand Down Expand Up @@ -386,7 +384,6 @@ class DefaultServerConfiguration : public virtual ServerConfiguration

CachedPtr<frontend::SessionAuthorizer> session_authorizer;
CachedPtr<renderer::RendererFactory> renderer_factory;
CachedPtr<compositor::BufferStreamFactory> buffer_stream_factory;
CachedPtr<scene::SurfaceStack> scene_surface_stack;
CachedPtr<shell::SurfaceStack> surface_stack;
CachedPtr<scene::SceneReport> scene_report;
Expand Down
48 changes: 0 additions & 48 deletions src/include/server/mir/scene/buffer_stream_factory.h

This file was deleted.

2 changes: 1 addition & 1 deletion src/server/compositor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ set(

default_display_buffer_compositor.cpp
default_display_buffer_compositor_factory.cpp
buffer_stream_factory.cpp
multi_threaded_compositor.cpp
occlusion.cpp
default_configuration.cpp
stream.cpp
${PROJECT_SOURCE_DIR}/src/include/server/mir/compositor/stream.h
multi_monitor_arbiter.cpp
basic_screen_shooter.cpp
null_screen_shooter.cpp
Expand Down
45 changes: 0 additions & 45 deletions src/server/compositor/buffer_stream_factory.cpp

This file was deleted.

51 changes: 0 additions & 51 deletions src/server/compositor/buffer_stream_factory.h

This file was deleted.

11 changes: 0 additions & 11 deletions src/server/compositor/default_configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

#include "mir/log.h"
#include "mir/shell/shell.h"
#include "buffer_stream_factory.h"
#include "default_display_buffer_compositor_factory.h"
#include "mir/executor.h"
#include "multi_threaded_compositor.h"
Expand All @@ -33,16 +32,6 @@ namespace mc = mir::compositor;
namespace ms = mir::scene;
namespace mg = mir::graphics;

std::shared_ptr<ms::BufferStreamFactory>
mir::DefaultServerConfiguration::the_buffer_stream_factory()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to do anything in the symbols.map file to remove this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

Hurray for extra CI checks!

{
return buffer_stream_factory(
[]()
{
return std::make_shared<mc::BufferStreamFactory>();
});
}

std::shared_ptr<mc::DisplayBufferCompositorFactory>
mir::DefaultServerConfiguration::the_display_buffer_compositor_factory()
{
Expand Down
4 changes: 2 additions & 2 deletions src/server/compositor/stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include "stream.h"
#include "mir/compositor/stream.h"
#include "multi_monitor_arbiter.h"
#include "mir/graphics/buffer.h"
#include <boost/throw_exception.hpp>
#include <math.h>

#include <cmath>

namespace mc = mir::compositor;
namespace geom = mir::geometry;
namespace mg = mir::graphics;
namespace geom = mir::geometry;

Expand Down
8 changes: 3 additions & 5 deletions src/server/scene/application_session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@
#include "mir/scene/session_container.h"
#include "mir/scene/session_listener.h"
#include "mir/scene/surface_factory.h"
#include "mir/scene/buffer_stream_factory.h"
#include "mir/shell/surface_stack.h"
#include "mir/shell/surface_specification.h"
#include "mir/compositor/buffer_stream.h"
#include "mir/compositor/stream.h"
#include "mir/events/event_builders.h"
#include "mir/frontend/event_sink.h"
#include "mir/graphics/graphic_buffer_allocator.h"
Expand All @@ -43,11 +42,11 @@ namespace msh = mir::shell;
namespace mg = mir::graphics;
namespace mev = mir::events;
namespace mc = mir::compositor;
namespace geom = mir::geometry;

ms::ApplicationSession::ApplicationSession(
std::shared_ptr<msh::SurfaceStack> const& surface_stack,
std::shared_ptr<SurfaceFactory> const& surface_factory,
std::shared_ptr<ms::BufferStreamFactory> const& buffer_stream_factory,
pid_t pid,
Fd socket_fd,
std::string const& session_name,
Expand All @@ -56,7 +55,6 @@ ms::ApplicationSession::ApplicationSession(
std::shared_ptr<graphics::GraphicBufferAllocator> const& gralloc) :
surface_stack(surface_stack),
surface_factory(surface_factory),
buffer_stream_factory(buffer_stream_factory),
pid(pid),
socket_fd_(socket_fd),
session_name(session_name),
Expand Down Expand Up @@ -292,7 +290,7 @@ void ms::ApplicationSession::resume_prompt_session()
auto ms::ApplicationSession::create_buffer_stream(mg::BufferProperties const& props)
-> std::shared_ptr<compositor::BufferStream>
{
auto stream = buffer_stream_factory->create_buffer_stream(props);
auto stream = std::make_shared<mc::Stream>(props.size, props.format);
session_listener->buffer_stream_created(*this, stream);

std::unique_lock lock(surfaces_and_streams_mutex);
Expand Down
3 changes: 0 additions & 3 deletions src/server/scene/application_session.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ namespace scene
{
class SessionListener;
class Surface;
class BufferStreamFactory;
class SurfaceFactory;

class ApplicationSession : public Session
Expand All @@ -46,7 +45,6 @@ class ApplicationSession : public Session
ApplicationSession(
std::shared_ptr<shell::SurfaceStack> const& surface_stack,
std::shared_ptr<SurfaceFactory> const& surface_factory,
std::shared_ptr<BufferStreamFactory> const& buffer_stream_factory,
pid_t pid,
Fd socket_fd,
std::string const& session_name,
Expand Down Expand Up @@ -99,7 +97,6 @@ class ApplicationSession : public Session
private:
std::shared_ptr<shell::SurfaceStack> const surface_stack;
std::shared_ptr<SurfaceFactory> const surface_factory;
std::shared_ptr<BufferStreamFactory> const buffer_stream_factory;
pid_t const pid;
Fd socket_fd_;
std::string const session_name;
Expand Down
1 change: 0 additions & 1 deletion src/server/scene/default_configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ mir::DefaultServerConfiguration::the_session_coordinator()
return std::make_shared<ms::SessionManager>(
the_surface_stack(),
the_surface_factory(),
the_buffer_stream_factory(),
the_session_container(),
the_session_event_sink(),
the_session_listener(),
Expand Down
3 changes: 0 additions & 3 deletions src/server/scene/session_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ struct ms::SessionManager::SessionObservers : mir::ObserverMultiplexer<ms::Sessi
ms::SessionManager::SessionManager(
std::shared_ptr<shell::SurfaceStack> const& surface_stack,
std::shared_ptr<SurfaceFactory> const& surface_factory,
std::shared_ptr<BufferStreamFactory> const& buffer_stream_factory,
std::shared_ptr<SessionContainer> const& container,
std::shared_ptr<SessionEventSink> const& session_event_sink,
std::shared_ptr<SessionListener> const& session_listener,
Expand All @@ -94,7 +93,6 @@ ms::SessionManager::SessionManager(
observers(std::make_shared<SessionObservers>()),
surface_stack(surface_stack),
surface_factory(surface_factory),
buffer_stream_factory(buffer_stream_factory),
app_container(container),
session_event_sink(session_event_sink),
session_listener(session_listener),
Expand Down Expand Up @@ -135,7 +133,6 @@ std::shared_ptr<ms::Session> ms::SessionManager::open_session(
std::shared_ptr<Session> new_session = std::make_shared<ApplicationSession>(
surface_stack,
surface_factory,
buffer_stream_factory,
client_pid,
socket_fd,
name,
Expand Down
3 changes: 0 additions & 3 deletions src/server/scene/session_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ class SessionEventSink;
class SessionListener;
class SurfaceStack;
class PromptSessionManager;
class BufferStreamFactory;
class SurfaceFactory;
class ApplicationNotRespondingDetector;

Expand All @@ -54,7 +53,6 @@ class SessionManager : public SessionCoordinator
SessionManager(
std::shared_ptr<shell::SurfaceStack> const& surface_stack,
std::shared_ptr<SurfaceFactory> const& surface_factory,
std::shared_ptr<BufferStreamFactory> const& buffer_stream_factory,
std::shared_ptr<SessionContainer> const& app_container,
std::shared_ptr<SessionEventSink> const& session_event_sink,
std::shared_ptr<SessionListener> const& session_listener,
Expand Down Expand Up @@ -91,7 +89,6 @@ class SessionManager : public SessionCoordinator
std::shared_ptr<SessionObservers> const observers;
std::shared_ptr<shell::SurfaceStack> const surface_stack;
std::shared_ptr<SurfaceFactory> const surface_factory;
std::shared_ptr<BufferStreamFactory> const buffer_stream_factory;
std::shared_ptr<SessionContainer> const app_container;
std::shared_ptr<SessionEventSink> const session_event_sink;
std::shared_ptr<SessionListener> const session_listener;
Expand Down
2 changes: 0 additions & 2 deletions src/server/scene/surface_allocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
*/

#include "surface_allocator.h"
#include "mir/scene/buffer_stream_factory.h"
#include "mir/shell/surface_specification.h"
#include "mir/compositor/buffer_stream.h"
#include "basic_surface.h"

namespace geom=mir::geometry;
Expand Down
1 change: 0 additions & 1 deletion src/server/scene/surface_allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ namespace graphics
class CursorImage;
class DisplayConfigurationObserver;
}
namespace compositor { class BufferStream; }
namespace scene
{
class SceneReport;
Expand Down
1 change: 0 additions & 1 deletion src/server/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ struct TemporaryCompositeEventFilter : public mi::CompositeEventFilter
MACRO(renderer_factory)

#define FOREACH_ACCESSOR(MACRO)\
MACRO(the_buffer_stream_factory)\
MACRO(the_compositor)\
MACRO(the_compositor_report)\
MACRO(the_cursor_listener)\
Expand Down
Loading
Loading