scenes/opengl: Remove viewport check

It's unreliable and it sometimes produces false positives (due to buggy
drivers).
This commit is contained in:
Vlad Zahorodnii 2021-11-03 19:00:50 +02:00
parent 1cf1703dec
commit 350144cde6
2 changed files with 0 additions and 22 deletions

View file

@ -75,9 +75,6 @@ SceneOpenGL::SceneOpenGL(OpenGLBackend *backend, QObject *parent)
: Scene(parent)
, m_backend(backend)
{
if (!viewportLimitsMatched(screens()->size()))
return;
// perform Scene specific checks
GLPlatform *glPlatform = GLPlatform::instance();
if (!glPlatform->isGLES() && !hasGLExtension(QByteArrayLiteral("GL_ARB_texture_non_power_of_two"))
@ -568,24 +565,6 @@ void SceneOpenGL::extendPaintRegion(QRegion &region, bool opaqueFullscreen)
}
}
bool SceneOpenGL::viewportLimitsMatched(const QSize &size) const {
if (kwinApp()->operationMode() != Application::OperationModeX11) {
// TODO: On Wayland we can't suspend. Find a solution that works here as well!
return true;
}
GLint limit[2];
glGetIntegerv(GL_MAX_VIEWPORT_DIMS, limit);
if (limit[0] < size.width() || limit[1] < size.height()) {
auto compositor = static_cast<X11Compositor*>(Compositor::self());
QMetaObject::invokeMethod(compositor, [compositor]() {
qCDebug(KWIN_OPENGL) << "Suspending compositing because viewport limits are not met";
compositor->suspend(X11Compositor::AllReasonSuspend);
}, Qt::QueuedConnection);
return false;
}
return true;
}
void SceneOpenGL::paintDesktop(int desktop, int mask, const QRegion &region, ScreenPaintData &data)
{
const QRect r = region.boundingRect();

View file

@ -79,7 +79,6 @@ protected:
void paintCursor(const QRegion &region) override;
private:
bool viewportLimitsMatched(const QSize &size) const;
void doPaintBackground(const QVector< float >& vertices);
void updateProjectionMatrix(const QRect &geometry);
void performPaintWindow(EffectWindowImpl* w, int mask, const QRegion &region, WindowPaintData& data);