diff --git a/src/backends/virtual/virtual_egl_backend.cpp b/src/backends/virtual/virtual_egl_backend.cpp index a21d419607..9dc183781b 100644 --- a/src/backends/virtual/virtual_egl_backend.cpp +++ b/src/backends/virtual/virtual_egl_backend.cpp @@ -21,7 +21,7 @@ namespace KWin { -VirtualEglLayerBuffer::VirtualEglLayerBuffer(GbmGraphicsBuffer *buffer, VirtualEglBackend *backend) +VirtualEglLayerBuffer::VirtualEglLayerBuffer(GraphicsBuffer *buffer, VirtualEglBackend *backend) : m_graphicsBuffer(buffer) { m_texture = backend->importDmaBufAsTexture(*buffer->dmabufAttributes()); @@ -35,7 +35,7 @@ VirtualEglLayerBuffer::~VirtualEglLayerBuffer() m_graphicsBuffer->drop(); } -GbmGraphicsBuffer *VirtualEglLayerBuffer::graphicsBuffer() const +GraphicsBuffer *VirtualEglLayerBuffer::graphicsBuffer() const { return m_graphicsBuffer; } @@ -71,7 +71,7 @@ std::shared_ptr VirtualEglSwapchain::acquire() } } - GbmGraphicsBuffer *graphicsBuffer = m_allocator->allocate(GraphicsBufferOptions{ + GraphicsBuffer *graphicsBuffer = m_allocator->allocate(GraphicsBufferOptions{ .size = m_size, .format = m_format, }); diff --git a/src/backends/virtual/virtual_egl_backend.h b/src/backends/virtual/virtual_egl_backend.h index f7e6f3ba64..1c3da2d320 100644 --- a/src/backends/virtual/virtual_egl_backend.h +++ b/src/backends/virtual/virtual_egl_backend.h @@ -15,8 +15,7 @@ namespace KWin { -class GbmGraphicsBuffer; -class GbmGraphicsBufferAllocator; +class GraphicsBufferAllocator; class VirtualBackend; class GLFramebuffer; class GLTexture; @@ -25,15 +24,15 @@ class VirtualEglBackend; class VirtualEglLayerBuffer { public: - VirtualEglLayerBuffer(GbmGraphicsBuffer *buffer, VirtualEglBackend *backend); + VirtualEglLayerBuffer(GraphicsBuffer *buffer, VirtualEglBackend *backend); ~VirtualEglLayerBuffer(); - GbmGraphicsBuffer *graphicsBuffer() const; + GraphicsBuffer *graphicsBuffer() const; GLFramebuffer *framebuffer() const; std::shared_ptr texture() const; private: - GbmGraphicsBuffer *m_graphicsBuffer; + GraphicsBuffer *m_graphicsBuffer; std::unique_ptr m_framebuffer; std::shared_ptr m_texture; }; @@ -51,7 +50,7 @@ private: VirtualEglBackend *m_backend; QSize m_size; uint32_t m_format; - std::unique_ptr m_allocator; + std::unique_ptr m_allocator; QVector> m_buffers; }; diff --git a/src/backends/virtual/virtual_qpainter_backend.cpp b/src/backends/virtual/virtual_qpainter_backend.cpp index 8dd4cedc9f..431f4882b5 100644 --- a/src/backends/virtual/virtual_qpainter_backend.cpp +++ b/src/backends/virtual/virtual_qpainter_backend.cpp @@ -33,7 +33,7 @@ static QImage::Format drmFormatToQImageFormat(uint32_t drmFormat) } } -VirtualQPainterBufferSlot::VirtualQPainterBufferSlot(ShmGraphicsBuffer *graphicsBuffer) +VirtualQPainterBufferSlot::VirtualQPainterBufferSlot(GraphicsBuffer *graphicsBuffer) : graphicsBuffer(graphicsBuffer) { const ShmAttributes *attributes = graphicsBuffer->shmAttributes(); @@ -77,7 +77,7 @@ std::shared_ptr VirtualQPainterSwapchain::acquire() } } - ShmGraphicsBuffer *buffer = m_allocator->allocate(GraphicsBufferOptions{ + GraphicsBuffer *buffer = m_allocator->allocate(GraphicsBufferOptions{ .size = m_size, .format = m_format, .software = true, diff --git a/src/backends/virtual/virtual_qpainter_backend.h b/src/backends/virtual/virtual_qpainter_backend.h index 066e1345e0..61ed5c39c1 100644 --- a/src/backends/virtual/virtual_qpainter_backend.h +++ b/src/backends/virtual/virtual_qpainter_backend.h @@ -19,17 +19,16 @@ namespace KWin { -class ShmGraphicsBuffer; -class ShmGraphicsBufferAllocator; +class GraphicsBufferAllocator; class VirtualBackend; class VirtualQPainterBufferSlot { public: - VirtualQPainterBufferSlot(ShmGraphicsBuffer *graphicsBuffer); + VirtualQPainterBufferSlot(GraphicsBuffer *graphicsBuffer); ~VirtualQPainterBufferSlot(); - ShmGraphicsBuffer *graphicsBuffer; + GraphicsBuffer *graphicsBuffer; QImage image; void *data = nullptr; int size; @@ -45,7 +44,7 @@ public: std::shared_ptr acquire(); private: - std::unique_ptr m_allocator; + std::unique_ptr m_allocator; QSize m_size; uint32_t m_format; std::vector> m_slots; diff --git a/src/backends/wayland/wayland_egl_backend.cpp b/src/backends/wayland/wayland_egl_backend.cpp index bef76243de..41e113fd77 100644 --- a/src/backends/wayland/wayland_egl_backend.cpp +++ b/src/backends/wayland/wayland_egl_backend.cpp @@ -30,7 +30,7 @@ namespace KWin namespace Wayland { -WaylandEglLayerBuffer::WaylandEglLayerBuffer(GbmGraphicsBuffer *buffer, WaylandEglBackend *backend) +WaylandEglLayerBuffer::WaylandEglLayerBuffer(GraphicsBuffer *buffer, WaylandEglBackend *backend) : m_graphicsBuffer(buffer) { m_texture = backend->importDmaBufAsTexture(*buffer->dmabufAttributes()); @@ -44,7 +44,7 @@ WaylandEglLayerBuffer::~WaylandEglLayerBuffer() m_graphicsBuffer->drop(); } -GbmGraphicsBuffer *WaylandEglLayerBuffer::graphicsBuffer() const +GraphicsBuffer *WaylandEglLayerBuffer::graphicsBuffer() const { return m_graphicsBuffer; } @@ -90,7 +90,7 @@ std::shared_ptr WaylandEglLayerSwapchain::acquire() } } - GbmGraphicsBuffer *graphicsBuffer = m_allocator->allocate(GraphicsBufferOptions{ + GraphicsBuffer *graphicsBuffer = m_allocator->allocate(GraphicsBufferOptions{ .size = m_size, .format = m_format, .modifiers = m_modifiers, diff --git a/src/backends/wayland/wayland_egl_backend.h b/src/backends/wayland/wayland_egl_backend.h index 50796e27a8..2dde15dcfe 100644 --- a/src/backends/wayland/wayland_egl_backend.h +++ b/src/backends/wayland/wayland_egl_backend.h @@ -18,8 +18,7 @@ namespace KWin { class GLFramebuffer; -class GbmGraphicsBuffer; -class GbmGraphicsBufferAllocator; +class GraphicsBufferAllocator; namespace Wayland { @@ -30,16 +29,16 @@ class WaylandEglBackend; class WaylandEglLayerBuffer { public: - WaylandEglLayerBuffer(GbmGraphicsBuffer *buffer, WaylandEglBackend *backend); + WaylandEglLayerBuffer(GraphicsBuffer *buffer, WaylandEglBackend *backend); ~WaylandEglLayerBuffer(); - GbmGraphicsBuffer *graphicsBuffer() const; + GraphicsBuffer *graphicsBuffer() const; GLFramebuffer *framebuffer() const; std::shared_ptr texture() const; int age() const; private: - GbmGraphicsBuffer *m_graphicsBuffer; + GraphicsBuffer *m_graphicsBuffer; std::unique_ptr m_framebuffer; std::shared_ptr m_texture; int m_age = 0; @@ -62,7 +61,7 @@ private: QSize m_size; uint32_t m_format; QVector m_modifiers; - std::unique_ptr m_allocator; + std::unique_ptr m_allocator; QVector> m_buffers; }; diff --git a/src/backends/wayland/wayland_qpainter_backend.cpp b/src/backends/wayland/wayland_qpainter_backend.cpp index d87af62560..e3a9f38b4d 100644 --- a/src/backends/wayland/wayland_qpainter_backend.cpp +++ b/src/backends/wayland/wayland_qpainter_backend.cpp @@ -37,7 +37,7 @@ static QImage::Format drmFormatToQImageFormat(uint32_t drmFormat) } } -WaylandQPainterBufferSlot::WaylandQPainterBufferSlot(ShmGraphicsBuffer *graphicsBuffer) +WaylandQPainterBufferSlot::WaylandQPainterBufferSlot(GraphicsBuffer *graphicsBuffer) : graphicsBuffer(graphicsBuffer) { const ShmAttributes *attributes = graphicsBuffer->shmAttributes(); @@ -81,7 +81,7 @@ std::shared_ptr WaylandQPainterSwapchain::acquire() } } - ShmGraphicsBuffer *buffer = m_allocator->allocate(GraphicsBufferOptions{ + GraphicsBuffer *buffer = m_allocator->allocate(GraphicsBufferOptions{ .size = m_size, .format = m_format, .software = true, diff --git a/src/backends/wayland/wayland_qpainter_backend.h b/src/backends/wayland/wayland_qpainter_backend.h index ab7eb84e3a..968f0ef47c 100644 --- a/src/backends/wayland/wayland_qpainter_backend.h +++ b/src/backends/wayland/wayland_qpainter_backend.h @@ -19,8 +19,7 @@ namespace KWin { class Output; -class ShmGraphicsBuffer; -class ShmGraphicsBufferAllocator; +class GraphicsBufferAllocator; namespace Wayland { @@ -32,10 +31,10 @@ class WaylandQPainterBackend; class WaylandQPainterBufferSlot { public: - WaylandQPainterBufferSlot(ShmGraphicsBuffer *graphicsBuffer); + WaylandQPainterBufferSlot(GraphicsBuffer *graphicsBuffer); ~WaylandQPainterBufferSlot(); - ShmGraphicsBuffer *graphicsBuffer; + GraphicsBuffer *graphicsBuffer; QImage image; void *data = nullptr; int size; @@ -53,7 +52,7 @@ public: void release(std::shared_ptr buffer); private: - std::unique_ptr m_allocator; + std::unique_ptr m_allocator; QSize m_size; uint32_t m_format; std::vector> m_slots; diff --git a/src/backends/x11/windowed/x11_windowed_egl_backend.cpp b/src/backends/x11/windowed/x11_windowed_egl_backend.cpp index e48cc0bcaa..7f5f5b7efb 100644 --- a/src/backends/x11/windowed/x11_windowed_egl_backend.cpp +++ b/src/backends/x11/windowed/x11_windowed_egl_backend.cpp @@ -19,7 +19,7 @@ namespace KWin { -X11WindowedEglLayerBuffer::X11WindowedEglLayerBuffer(GbmGraphicsBuffer *graphicsBuffer, X11WindowedEglBackend *backend) +X11WindowedEglLayerBuffer::X11WindowedEglLayerBuffer(GraphicsBuffer *graphicsBuffer, X11WindowedEglBackend *backend) : m_graphicsBuffer(graphicsBuffer) { m_texture = backend->importDmaBufAsTexture(*graphicsBuffer->dmabufAttributes()); @@ -79,7 +79,7 @@ std::shared_ptr X11WindowedEglLayerSwapchain::acquire } } - GbmGraphicsBuffer *graphicsBuffer = m_allocator->allocate(GraphicsBufferOptions{ + GraphicsBuffer *graphicsBuffer = m_allocator->allocate(GraphicsBufferOptions{ .size = m_size, .format = m_format, .modifiers = m_modifiers, diff --git a/src/backends/x11/windowed/x11_windowed_egl_backend.h b/src/backends/x11/windowed/x11_windowed_egl_backend.h index d205d8cc0b..41080bbd01 100644 --- a/src/backends/x11/windowed/x11_windowed_egl_backend.h +++ b/src/backends/x11/windowed/x11_windowed_egl_backend.h @@ -15,8 +15,7 @@ namespace KWin { -class GbmGraphicsBuffer; -class GbmGraphicsBufferAllocator; +class GraphicsBufferAllocator; class X11WindowedBackend; class X11WindowedOutput; class X11WindowedEglBackend; @@ -24,7 +23,7 @@ class X11WindowedEglBackend; class X11WindowedEglLayerBuffer { public: - X11WindowedEglLayerBuffer(GbmGraphicsBuffer *graphicsBuffers, X11WindowedEglBackend *backend); + X11WindowedEglLayerBuffer(GraphicsBuffer *graphicsBuffers, X11WindowedEglBackend *backend); ~X11WindowedEglLayerBuffer(); GraphicsBuffer *graphicsBuffer() const; @@ -33,7 +32,7 @@ public: int age() const; private: - GbmGraphicsBuffer *m_graphicsBuffer; + GraphicsBuffer *m_graphicsBuffer; std::unique_ptr m_framebuffer; std::shared_ptr m_texture; int m_age = 0; @@ -53,7 +52,7 @@ public: private: X11WindowedEglBackend *m_backend; - std::unique_ptr m_allocator; + std::unique_ptr m_allocator; QSize m_size; uint32_t m_format; QVector m_modifiers; diff --git a/src/backends/x11/windowed/x11_windowed_qpainter_backend.cpp b/src/backends/x11/windowed/x11_windowed_qpainter_backend.cpp index 29ce502eb4..72370c7569 100644 --- a/src/backends/x11/windowed/x11_windowed_qpainter_backend.cpp +++ b/src/backends/x11/windowed/x11_windowed_qpainter_backend.cpp @@ -34,7 +34,7 @@ static QImage::Format drmFormatToQImageFormat(uint32_t drmFormat) } } -X11WindowedQPainterLayerBuffer::X11WindowedQPainterLayerBuffer(ShmGraphicsBuffer *buffer) +X11WindowedQPainterLayerBuffer::X11WindowedQPainterLayerBuffer(GraphicsBuffer *buffer) : m_graphicsBuffer(buffer) { const ShmAttributes *attributes = buffer->shmAttributes(); @@ -58,7 +58,7 @@ X11WindowedQPainterLayerBuffer::~X11WindowedQPainterLayerBuffer() m_graphicsBuffer->drop(); } -ShmGraphicsBuffer *X11WindowedQPainterLayerBuffer::graphicsBuffer() const +GraphicsBuffer *X11WindowedQPainterLayerBuffer::graphicsBuffer() const { return m_graphicsBuffer; } @@ -88,7 +88,7 @@ std::shared_ptr X11WindowedQPainterLayerSwapchai } } - ShmGraphicsBuffer *graphicsBuffer = m_allocator->allocate(GraphicsBufferOptions{ + GraphicsBuffer *graphicsBuffer = m_allocator->allocate(GraphicsBufferOptions{ .size = m_size, .format = m_format, .software = true, diff --git a/src/backends/x11/windowed/x11_windowed_qpainter_backend.h b/src/backends/x11/windowed/x11_windowed_qpainter_backend.h index ca1fca8d54..49070b4719 100644 --- a/src/backends/x11/windowed/x11_windowed_qpainter_backend.h +++ b/src/backends/x11/windowed/x11_windowed_qpainter_backend.h @@ -20,22 +20,21 @@ namespace KWin { -class ShmGraphicsBuffer; -class ShmGraphicsBufferAllocator; +class GraphicsBufferAllocator; class X11WindowedBackend; class X11WindowedOutput; class X11WindowedQPainterLayerBuffer { public: - X11WindowedQPainterLayerBuffer(ShmGraphicsBuffer *buffer); + X11WindowedQPainterLayerBuffer(GraphicsBuffer *buffer); ~X11WindowedQPainterLayerBuffer(); - ShmGraphicsBuffer *graphicsBuffer() const; + GraphicsBuffer *graphicsBuffer() const; QImage *view() const; private: - ShmGraphicsBuffer *m_graphicsBuffer; + GraphicsBuffer *m_graphicsBuffer; void *m_data = nullptr; int m_size = 0; std::unique_ptr m_view; @@ -53,7 +52,7 @@ public: private: QSize m_size; uint32_t m_format; - std::unique_ptr m_allocator; + std::unique_ptr m_allocator; QVector> m_buffers; }; diff --git a/src/core/gbmgraphicsbufferallocator.cpp b/src/core/gbmgraphicsbufferallocator.cpp index 071292d0ae..27e2446b04 100644 --- a/src/core/gbmgraphicsbufferallocator.cpp +++ b/src/core/gbmgraphicsbufferallocator.cpp @@ -22,7 +22,7 @@ GbmGraphicsBufferAllocator::~GbmGraphicsBufferAllocator() { } -GbmGraphicsBuffer *GbmGraphicsBufferAllocator::allocate(const GraphicsBufferOptions &options) +GraphicsBuffer *GbmGraphicsBufferAllocator::allocate(const GraphicsBufferOptions &options) { if (options.software) { gbm_bo *bo = gbm_bo_create(m_gbmDevice, diff --git a/src/core/gbmgraphicsbufferallocator.h b/src/core/gbmgraphicsbufferallocator.h index 5c62e390b0..95df0648c4 100644 --- a/src/core/gbmgraphicsbufferallocator.h +++ b/src/core/gbmgraphicsbufferallocator.h @@ -45,7 +45,7 @@ public: explicit GbmGraphicsBufferAllocator(gbm_device *device); ~GbmGraphicsBufferAllocator() override; - GbmGraphicsBuffer *allocate(const GraphicsBufferOptions &options) override; + GraphicsBuffer *allocate(const GraphicsBufferOptions &options) override; private: gbm_device *m_gbmDevice; diff --git a/src/core/shmgraphicsbufferallocator.cpp b/src/core/shmgraphicsbufferallocator.cpp index 2c1256973d..fcc0bbfffc 100644 --- a/src/core/shmgraphicsbufferallocator.cpp +++ b/src/core/shmgraphicsbufferallocator.cpp @@ -36,7 +36,7 @@ const ShmAttributes *ShmGraphicsBuffer::shmAttributes() const return &m_attributes; } -ShmGraphicsBuffer *ShmGraphicsBufferAllocator::allocate(const GraphicsBufferOptions &options) +GraphicsBuffer *ShmGraphicsBufferAllocator::allocate(const GraphicsBufferOptions &options) { if (!options.software) { return nullptr; diff --git a/src/core/shmgraphicsbufferallocator.h b/src/core/shmgraphicsbufferallocator.h index 74a94e0743..41119abb22 100644 --- a/src/core/shmgraphicsbufferallocator.h +++ b/src/core/shmgraphicsbufferallocator.h @@ -32,7 +32,7 @@ private: class KWIN_EXPORT ShmGraphicsBufferAllocator : public GraphicsBufferAllocator { public: - ShmGraphicsBuffer *allocate(const GraphicsBufferOptions &options) override; + GraphicsBuffer *allocate(const GraphicsBufferOptions &options) override; }; } // namespace KWin