Add OpenGL init crash checker.
This commit is contained in:
parent
802918dd11
commit
f58fd1b927
3 changed files with 19 additions and 0 deletions
|
|
@ -6,6 +6,7 @@
|
|||
//
|
||||
#include "ui/gl/gl_detection.h"
|
||||
|
||||
#include "ui/integration.h"
|
||||
#include "base/debug_log.h"
|
||||
|
||||
#include <QtCore/QSet>
|
||||
|
|
@ -45,7 +46,11 @@ Capabilities CheckCapabilities(QWidget *widget) {
|
|||
}
|
||||
auto tester = QOpenGLWidget(widget);
|
||||
tester.setFormat(format);
|
||||
|
||||
Ui::Integration::Instance().openglCheckStart();
|
||||
tester.grabFramebuffer(); // Force initialize().
|
||||
Ui::Integration::Instance().openglCheckFinish();
|
||||
|
||||
if (!tester.window()->windowHandle()) {
|
||||
tester.window()->createWinId();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,16 @@ bool Integration::Exists() {
|
|||
return (IntegrationInstance != nullptr);
|
||||
}
|
||||
|
||||
void Integration::openglCheckStart() {
|
||||
}
|
||||
|
||||
void Integration::openglCheckFinish() {
|
||||
}
|
||||
|
||||
bool Integration::openglLastCheckFailed() {
|
||||
return false;
|
||||
}
|
||||
|
||||
void Integration::textActionsUpdated() {
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,6 +35,10 @@ public:
|
|||
virtual void registerLeaveSubscription(not_null<QWidget*> widget) = 0;
|
||||
virtual void unregisterLeaveSubscription(not_null<QWidget*> widget) = 0;
|
||||
|
||||
virtual void openglCheckStart();
|
||||
virtual void openglCheckFinish();
|
||||
[[nodiscard]] virtual bool openglLastCheckFailed();
|
||||
|
||||
[[nodiscard]] virtual QString emojiCacheFolder() = 0;
|
||||
|
||||
virtual void textActionsUpdated();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue