94
78
virtual QImage *buffer() = 0;
80
* Overload for the case that there is a different buffer per screen.
81
* Default implementation just calls buffer.
82
* @param screenId The id of the screen as used in Screens
83
* @todo Get a better identifier for screen then a counter variable
85
virtual QImage *bufferForScreen(int screenId);
95
86
virtual bool needsFullRepaint() const = 0;
96
87
virtual void renderCursor(QPainter *painter);
89
* Whether the rendering needs to be split per screen.
90
* Default implementation returns @c false.
92
virtual bool perScreenRendering() const;
115
class WaylandQPainterBackend : public QObject, public QPainterBackend
119
explicit WaylandQPainterBackend(Wayland::WaylandBackend *b);
120
virtual ~WaylandQPainterBackend();
122
virtual void present(int mask, const QRegion& damage) override;
123
virtual bool usesOverlayWindow() const override;
124
virtual void screenGeometryChanged(const QSize &size) override;
125
virtual QImage *buffer() override;
126
virtual void prepareRenderingFrame() override;
127
virtual bool needsFullRepaint() const override;
131
Wayland::WaylandBackend *m_backend;
132
bool m_needsFullRepaint;
134
QWeakPointer<KWayland::Client::Buffer> m_buffer;
137
class X11WindowedQPainterBackend : public QObject, public QPainterBackend
141
X11WindowedQPainterBackend(X11WindowedBackend *backend);
142
virtual ~X11WindowedQPainterBackend();
144
QImage *buffer() override;
145
bool needsFullRepaint() const override;
146
bool usesOverlayWindow() const override;
147
void prepareRenderingFrame() override;
148
void present(int mask, const QRegion &damage) override;
149
void screenGeometryChanged(const QSize &size);
152
bool m_needsFullRepaint = true;
153
xcb_gcontext_t m_gc = XCB_NONE;
155
X11WindowedBackend *m_backend;
158
class FramebufferQPainterBackend : public QObject, public QPainterBackend
162
FramebufferQPainterBackend(FramebufferBackend *backend);
163
virtual ~FramebufferQPainterBackend();
165
QImage *buffer() override;
166
bool needsFullRepaint() const override;
167
bool usesOverlayWindow() const override;
168
void prepareRenderingFrame() override;
169
void present(int mask, const QRegion &damage) override;
170
void renderCursor(QPainter *painter) override;
173
QImage m_renderBuffer;
175
FramebufferBackend *m_backend;
179
110
class SceneQPainter : public Scene