Commit 8739258f authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

Drop Platform::isPerScreenRenderingEnabled()

At this point, it's safe to assume that only X11 has weird rendering
model, which stands in the way of making rendering abstractions nice and
intuitive, so let's check operation mode. If OperationModeX11 is
dropped, this will also simplify finding X11-specific code in kwin.
parent 5933a216
......@@ -62,7 +62,6 @@ DrmBackend::DrmBackend(QObject *parent)
{
setSupportsPointerWarping(true);
setSupportsGammaControl(true);
setPerScreenRenderingEnabled(true);
supportsOutputChanges();
}
......
......@@ -79,7 +79,6 @@ FramebufferBackend::FramebufferBackend(QObject *parent)
: Platform(parent)
, m_session(Session::create(this))
{
setPerScreenRenderingEnabled(true);
setSupportsPointerWarping(true);
}
......
......@@ -164,7 +164,6 @@ VirtualBackend::VirtualBackend(QObject *parent)
supportsOutputChanges();
setSupportsPointerWarping(true);
setSupportsGammaControl(true);
setPerScreenRenderingEnabled(true);
}
VirtualBackend::~VirtualBackend()
......
......@@ -579,7 +579,6 @@ WaylandBackend::WaylandBackend(QObject *parent)
, m_connectionThreadObject(new ConnectionThread(nullptr))
, m_connectionThread(nullptr)
{
setPerScreenRenderingEnabled(true);
supportsOutputChanges();
connect(this, &WaylandBackend::connectionFailed, qApp, &QCoreApplication::quit);
......
......@@ -112,7 +112,6 @@ X11StandalonePlatform::X11StandalonePlatform(QObject *parent)
connect(m_updateOutputsTimer, &QTimer::timeout, this, &X11StandalonePlatform::updateOutputs);
setSupportsGammaControl(true);
setPerScreenRenderingEnabled(false);
}
X11StandalonePlatform::~X11StandalonePlatform()
......
......@@ -164,7 +164,6 @@ X11WindowedBackend::X11WindowedBackend(QObject *parent)
, m_session(Session::create(Session::Type::Noop, this))
{
setSupportsPointerWarping(true);
setPerScreenRenderingEnabled(true);
}
X11WindowedBackend::~X11WindowedBackend()
......
......@@ -257,7 +257,7 @@ void Item::scheduleRepaintInternal(const QRegion &region)
{
const QVector<AbstractOutput *> outputs = kwinApp()->platform()->enabledOutputs();
const QRegion globalRegion = mapToGlobal(region);
if (kwinApp()->platform()->isPerScreenRenderingEnabled()) {
if (kwinApp()->operationMode() != Application::OperationModeX11) {
for (const auto &output : outputs) {
const QRegion dirtyRegion = globalRegion & output->geometry();
if (!dirtyRegion.isEmpty()) {
......@@ -277,7 +277,7 @@ void Item::scheduleFrame()
return;
}
const QVector<AbstractOutput *> outputs = kwinApp()->platform()->enabledOutputs();
if (kwinApp()->platform()->isPerScreenRenderingEnabled()) {
if (kwinApp()->operationMode() != Application::OperationModeX11) {
const QRect geometry = mapToGlobal(rect());
for (const AbstractOutput *output : outputs) {
if (output->geometry().intersects(geometry)) {
......
......@@ -409,16 +409,6 @@ void Platform::setReady(bool ready)
Q_EMIT readyChanged(m_ready);
}
bool Platform::isPerScreenRenderingEnabled() const
{
return m_isPerScreenRenderingEnabled;
}
void Platform::setPerScreenRenderingEnabled(bool enabled)
{
m_isPerScreenRenderingEnabled = enabled;
}
AbstractOutput *Platform::createVirtualOutput(const QString &name, const QSize &size, double scale)
{
Q_UNUSED(name);
......
......@@ -338,11 +338,6 @@ public:
m_selectedCompositor = type;
}
/**
* Returns @c true if rendering is split per screen; otherwise returns @c false.
*/
bool isPerScreenRenderingEnabled() const;
virtual AbstractOutput *createVirtualOutput(const QString &name, const QSize &size, qreal scaling);
virtual void removeVirtualOutput(AbstractOutput *output);
......@@ -425,7 +420,6 @@ protected:
explicit Platform(QObject *parent = nullptr);
void repaint(const QRect &rect);
void setReady(bool ready);
void setPerScreenRenderingEnabled(bool enabled);
QSize initialWindowSize() const {
return m_initialWindowSize;
}
......@@ -457,7 +451,6 @@ private:
EGLContext m_globalShareContext = EGL_NO_CONTEXT;
bool m_supportsGammaControl = false;
bool m_supportsOutputChanges = false;
bool m_isPerScreenRenderingEnabled = false;
CompositingType m_selectedCompositor = NoCompositing;
AbstractOutput *m_primaryOutput = nullptr;
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment