backends/{wayland,x11}: Remove unused args

This commit is contained in:
Vlad Zahorodnii 2023-05-10 17:41:03 +03:00
parent 37aef0c015
commit 9af9e93ef6
4 changed files with 14 additions and 19 deletions

View file

@ -10,7 +10,6 @@
#include "wayland_qpainter_backend.h"
#include "core/shmgraphicsbufferallocator.h"
#include "wayland_backend.h"
#include "wayland_display.h"
#include "wayland_logging.h"
#include "wayland_output.h"
@ -38,7 +37,7 @@ static QImage::Format drmFormatToQImageFormat(uint32_t drmFormat)
}
}
WaylandQPainterBufferSlot::WaylandQPainterBufferSlot(WaylandDisplay *display, ShmGraphicsBuffer *graphicsBuffer)
WaylandQPainterBufferSlot::WaylandQPainterBufferSlot(ShmGraphicsBuffer *graphicsBuffer)
: graphicsBuffer(graphicsBuffer)
{
const ShmAttributes *attributes = graphicsBuffer->shmAttributes();
@ -62,9 +61,8 @@ WaylandQPainterBufferSlot::~WaylandQPainterBufferSlot()
graphicsBuffer->drop();
}
WaylandQPainterSwapchain::WaylandQPainterSwapchain(WaylandOutput *output, const QSize &size, uint32_t format)
WaylandQPainterSwapchain::WaylandQPainterSwapchain(const QSize &size, uint32_t format)
: m_allocator(std::make_unique<ShmGraphicsBufferAllocator>())
, m_output(output)
, m_size(size)
, m_format(format)
{
@ -89,7 +87,7 @@ std::shared_ptr<WaylandQPainterBufferSlot> WaylandQPainterSwapchain::acquire()
return nullptr;
}
auto slot = std::make_shared<WaylandQPainterBufferSlot>(m_output->backend()->display(), buffer);
auto slot = std::make_shared<WaylandQPainterBufferSlot>(buffer);
m_slots.push_back(slot);
return slot;
@ -134,7 +132,7 @@ std::optional<OutputLayerBeginFrameInfo> WaylandQPainterPrimaryLayer::beginFrame
{
const QSize nativeSize(m_waylandOutput->modeSize());
if (!m_swapchain || m_swapchain->size() != nativeSize) {
m_swapchain = std::make_unique<WaylandQPainterSwapchain>(m_waylandOutput, nativeSize, DRM_FORMAT_XRGB8888);
m_swapchain = std::make_unique<WaylandQPainterSwapchain>(nativeSize, DRM_FORMAT_XRGB8888);
}
m_back = m_swapchain->acquire();
@ -169,7 +167,7 @@ std::optional<OutputLayerBeginFrameInfo> WaylandQPainterCursorLayer::beginFrame(
const auto tmp = size().expandedTo(QSize(64, 64));
const QSize bufferSize(std::ceil(tmp.width()), std::ceil(tmp.height()));
if (!m_swapchain || m_swapchain->size() != bufferSize) {
m_swapchain = std::make_unique<WaylandQPainterSwapchain>(m_output, bufferSize, DRM_FORMAT_ARGB8888);
m_swapchain = std::make_unique<WaylandQPainterSwapchain>(bufferSize, DRM_FORMAT_ARGB8888);
}
m_back = m_swapchain->acquire();

View file

@ -32,7 +32,7 @@ class WaylandQPainterBackend;
class WaylandQPainterBufferSlot
{
public:
WaylandQPainterBufferSlot(WaylandDisplay *display, ShmGraphicsBuffer *graphicsBuffer);
WaylandQPainterBufferSlot(ShmGraphicsBuffer *graphicsBuffer);
~WaylandQPainterBufferSlot();
ShmGraphicsBuffer *graphicsBuffer;
@ -45,7 +45,7 @@ public:
class WaylandQPainterSwapchain
{
public:
WaylandQPainterSwapchain(WaylandOutput *output, const QSize &size, uint32_t format);
WaylandQPainterSwapchain(const QSize &size, uint32_t format);
QSize size() const;
@ -54,7 +54,6 @@ public:
private:
std::unique_ptr<ShmGraphicsBufferAllocator> m_allocator;
WaylandOutput *m_output;
QSize m_size;
uint32_t m_format;
std::vector<std::shared_ptr<WaylandQPainterBufferSlot>> m_slots;

View file

@ -34,7 +34,7 @@ static QImage::Format drmFormatToQImageFormat(uint32_t drmFormat)
}
}
X11WindowedQPainterLayerBuffer::X11WindowedQPainterLayerBuffer(ShmGraphicsBuffer *buffer, X11WindowedOutput *output)
X11WindowedQPainterLayerBuffer::X11WindowedQPainterLayerBuffer(ShmGraphicsBuffer *buffer)
: m_graphicsBuffer(buffer)
{
const ShmAttributes *attributes = buffer->shmAttributes();
@ -68,9 +68,8 @@ QImage *X11WindowedQPainterLayerBuffer::view() const
return m_view.get();
}
X11WindowedQPainterLayerSwapchain::X11WindowedQPainterLayerSwapchain(const QSize &size, uint32_t format, X11WindowedOutput *output)
: m_output(output)
, m_size(size)
X11WindowedQPainterLayerSwapchain::X11WindowedQPainterLayerSwapchain(const QSize &size, uint32_t format)
: m_size(size)
, m_format(format)
, m_allocator(std::make_unique<ShmGraphicsBufferAllocator>())
{
@ -95,7 +94,7 @@ std::shared_ptr<X11WindowedQPainterLayerBuffer> X11WindowedQPainterLayerSwapchai
return nullptr;
}
auto buffer = std::make_shared<X11WindowedQPainterLayerBuffer>(graphicsBuffer, m_output);
auto buffer = std::make_shared<X11WindowedQPainterLayerBuffer>(graphicsBuffer);
m_buffers.push_back(buffer);
return buffer;
@ -110,7 +109,7 @@ std::optional<OutputLayerBeginFrameInfo> X11WindowedQPainterPrimaryLayer::beginF
{
const QSize bufferSize = m_output->modeSize();
if (!m_swapchain || m_swapchain->size() != bufferSize) {
m_swapchain = std::make_unique<X11WindowedQPainterLayerSwapchain>(bufferSize, m_output->backend()->driFormatForDepth(m_output->depth()), m_output);
m_swapchain = std::make_unique<X11WindowedQPainterLayerSwapchain>(bufferSize, m_output->backend()->driFormatForDepth(m_output->depth()));
}
m_current = m_swapchain->acquire();

View file

@ -28,7 +28,7 @@ class X11WindowedOutput;
class X11WindowedQPainterLayerBuffer
{
public:
X11WindowedQPainterLayerBuffer(ShmGraphicsBuffer *buffer, X11WindowedOutput *output);
X11WindowedQPainterLayerBuffer(ShmGraphicsBuffer *buffer);
~X11WindowedQPainterLayerBuffer();
ShmGraphicsBuffer *graphicsBuffer() const;
@ -44,14 +44,13 @@ private:
class X11WindowedQPainterLayerSwapchain
{
public:
X11WindowedQPainterLayerSwapchain(const QSize &size, uint32_t format, X11WindowedOutput *output);
X11WindowedQPainterLayerSwapchain(const QSize &size, uint32_t format);
QSize size() const;
std::shared_ptr<X11WindowedQPainterLayerBuffer> acquire();
private:
X11WindowedOutput *m_output;
QSize m_size;
uint32_t m_format;
std::unique_ptr<ShmGraphicsBufferAllocator> m_allocator;