Commit d627c54f authored by Michael Abrahams's avatar Michael Abrahams

Remove a dangling OpenGL call.

Summary: This is for the Intel graphics card check. Part of T360

Reviewers: rempt

Differential Revision: https://phabricator.kde.org/D251
parent 0b81556c
......@@ -56,6 +56,8 @@
#include <QToolBar>
#include <QUrl>
#include <QStatusBar>
#include <QOpenGLContext>
#include <QOpenGLFunctions>
#include <kis_image.h>
#include <kis_node.h>
......@@ -269,23 +271,6 @@ KisView::KisView(KisDocument *document, KoCanvasResourceManager *resourceManager
grp.sync();
d->canvas = new KisCanvas2(d->viewConverter, resourceManager, this, document->shapeController());
/**
* Warn about Intel's broken video drivers
*/
#if defined HAVE_OPENGL && defined Q_OS_WIN
QString renderer((const char*)glGetString(GL_RENDERER));
if (cfg.useOpenGL() && renderer.startsWith("Intel") && !cfg.readEntry("WarnedAboutIntel", false)) {
QMessageBox::information(0,
i18nc("@title:window", "Krita: Warning"),
i18n("You have an Intel(R) HD Graphics video adapter.\n"
"If you experience problems like a black or blank screen,"
"please update your display driver to the latest version.\n\n"
"You can also disable OpenGL rendering in Krita's Settings.\n"));
cfg.writeEntry("WarnedAboutIntel", true);
}
#endif /* defined HAVE_OPENGL && defined Q_OS_WIN32 */
grp.writeEntry("CreatingCanvas", false);
grp.sync();
......
......@@ -232,10 +232,11 @@ void KisOpenGLCanvas2::initializeGL()
// }
// }
// }
KisConfig cfg;
qDebug() << "OpenGL: Preparing to initialize OpenGL for KisCanvas";
int glVersion = KisOpenGL::initializeContext(context());
qDebug() << "OpenGL: Context gives version" << glVersion;
qDebug() << "OpenGL: Version found" << glVersion;
initializeOpenGLFunctions();
VSyncWorkaround::tryDisableVSync(context());
......@@ -246,6 +247,28 @@ void KisOpenGLCanvas2::initializeGL()
Sync::init();
/**
* Warn about Intel's broken video drivers
*/
#if defined HAVE_OPENGL && defined Q_OS_WIN
#ifndef GL_RENDERER
# define GL_RENDERER 0x1F01
#endif
QString renderer = QString((const char*)glGetString(GL_RENDERER));
if (cfg.useOpenGL() && renderer.startsWith("Intel") && !cfg.readEntry("WarnedAboutIntel", false)) {
QMessageBox::information(0,
i18nc("@title:window", "Krita: Warning"),
i18n("You have an Intel(R) HD Graphics video adapter.\n"
"If you experience problems like a black or blank screen,"
"please update your display driver to the latest version.\n\n"
"You can also disable OpenGL rendering in Krita's Settings.\n"));
cfg.writeEntry("WarnedAboutIntel", true);
}
#endif
d->canvasInitialized = true;
}
......
Markdown is supported
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