56
public compositor::CompositingCriteria,
57
public input::Surface,
58
public MutableSurfaceState
56
BasicSurface(std::shared_ptr<SurfaceData> const& surface_data,
62
std::string const& name,
63
geometry::Rectangle rect,
64
std::function<void()> change_cb,
57
66
std::shared_ptr<compositor::BufferStream> const& buffer_stream,
58
67
std::shared_ptr<input::InputChannel> const& input_channel,
59
68
std::shared_ptr<SceneReport> const& report);
61
virtual ~BasicSurface();
63
virtual std::string const& name() const;
64
virtual void move_to(geometry::Point const& top_left);
65
virtual void set_rotation(float degrees, glm::vec3 const& axis);
66
virtual float alpha() const;
67
virtual void set_alpha(float alpha);
68
virtual void set_hidden(bool is_hidden);
70
virtual geometry::Point top_left() const;
71
virtual geometry::Size size() const;
73
virtual MirPixelFormat pixel_format() const;
75
virtual std::shared_ptr<graphics::Buffer> snapshot_buffer() const;
76
virtual void swap_buffers(graphics::Buffer* old_buffer, std::function<void(graphics::Buffer* new_buffer)> complete);
77
virtual void force_requests_to_complete();
79
virtual bool supports_input() const;
80
virtual int client_input_fd() const;
81
virtual void allow_framedropping(bool);
82
virtual std::shared_ptr<input::InputChannel> input_channel() const;
84
virtual void set_input_region(std::vector<geometry::Rectangle> const& input_rectangles);
86
virtual std::shared_ptr<compositor::CompositingCriteria> compositing_criteria();
88
virtual std::shared_ptr<compositor::BufferStream> buffer_stream() const;
90
virtual std::shared_ptr<input::Surface> input_surface() const;
70
~BasicSurface() noexcept;
72
std::string const& name() const override;
73
void move_to(geometry::Point const& top_left) override;
74
float alpha() const override;
75
void set_hidden(bool is_hidden) override;
77
geometry::Size size() const override;
79
MirPixelFormat pixel_format() const;
81
std::shared_ptr<graphics::Buffer> snapshot_buffer() const;
82
void swap_buffers(graphics::Buffer* old_buffer, std::function<void(graphics::Buffer* new_buffer)> complete);
83
void force_requests_to_complete();
85
bool supports_input() const;
86
int client_input_fd() const;
87
void allow_framedropping(bool);
88
std::shared_ptr<input::InputChannel> input_channel() const;
90
void set_input_region(std::vector<geometry::Rectangle> const& input_rectangles) override;
92
std::shared_ptr<compositor::BufferStream> buffer_stream() const;
93
95
* Resize the surface.
94
96
* \returns true if the size changed, false if it was already that size.
95
97
* \throws std::logic_error For impossible sizes like {0,0}.
97
virtual bool resize(geometry::Size const& size);
99
bool resize(geometry::Size const& size) override;
100
geometry::Point top_left() const override;
101
bool contains(geometry::Point const& point) const override;
102
void frame_posted() override;
103
void set_alpha(float alpha) override;
104
void set_rotation(float degrees, glm::vec3 const&) override;
105
glm::mat4 const& transformation() const override;
106
bool should_be_rendered_in(geometry::Rectangle const& rect) const override;
107
bool shaped() const override; // meaning the pixel format has alpha
100
110
BasicSurface(BasicSurface const&) = delete;
101
111
BasicSurface& operator=(BasicSurface const&) = delete;
103
std::shared_ptr<SurfaceData> surface_data;
104
std::shared_ptr<compositor::BufferStream> surface_buffer_stream;
113
std::mutex mutable guard;
114
std::function<void()> const notify_change;
115
std::string const surface_name;
116
geometry::Rectangle surface_rect;
117
glm::mat4 rotation_matrix;
118
mutable glm::mat4 transformation_matrix;
119
mutable geometry::Size transformation_size;
120
mutable bool transformation_dirty;
122
bool first_frame_posted;
124
const bool nonrectangular;
125
std::vector<geometry::Rectangle> input_rectangles;
126
std::shared_ptr<compositor::BufferStream> const surface_buffer_stream;
105
127
std::shared_ptr<input::InputChannel> const server_input_channel;
106
128
std::shared_ptr<SceneReport> const report;