mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Add basic OpenGL info to crash annotations.
This commit is contained in:
parent
27d58ba07b
commit
7e6f24552a
3 changed files with 33 additions and 0 deletions
|
@ -42,6 +42,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "lang/lang_instance.h"
|
||||
#include "mainwidget.h"
|
||||
#include "core/file_utilities.h"
|
||||
#include "core/crash_reports.h"
|
||||
#include "main/main_account.h"
|
||||
#include "main/main_domain.h"
|
||||
#include "main/main_session.h"
|
||||
|
@ -94,6 +95,27 @@ constexpr auto kQuitPreventTimeoutMs = crl::time(1500);
|
|||
constexpr auto kAutoLockTimeoutLateMs = crl::time(3000);
|
||||
constexpr auto kClearEmojiImageSourceTimeout = 10 * crl::time(1000);
|
||||
|
||||
void SetCrashAnnotationsGL() {
|
||||
#ifdef Q_OS_WIN
|
||||
CrashReports::SetAnnotation("OpenGL ANGLE", [] {
|
||||
if (Core::App().settings().disableOpenGL()) {
|
||||
return "Disabled";
|
||||
} else switch (Ui::GL::CurrentANGLE()) {
|
||||
case Ui::GL::ANGLE::Auto: return "Auto";
|
||||
case Ui::GL::ANGLE::D3D11: return "Direct3D 11";
|
||||
case Ui::GL::ANGLE::D3D9: return "Direct3D 9";
|
||||
case Ui::GL::ANGLE::D3D11on12: return "D3D11on12";
|
||||
case Ui::GL::ANGLE::OpenGL: return "OpenGL";
|
||||
}
|
||||
Unexpected("Ui::GL::CurrentANGLE value in SetupANGLE.");
|
||||
}());
|
||||
#else // Q_OS_WIN
|
||||
CrashReports::SetAnnotation(
|
||||
"OpenGL",
|
||||
Core::App().settings().disableOpenGL() ? "Disabled" : "Enabled");
|
||||
#endif // Q_OS_WIN
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
Application *Application::Instance = nullptr;
|
||||
|
@ -287,6 +309,7 @@ void Application::run() {
|
|||
LOG(("Shortcuts Error: %1").arg(error));
|
||||
}
|
||||
|
||||
SetCrashAnnotationsGL();
|
||||
if (!Platform::IsMac() && Ui::GL::LastCrashCheckFailed()) {
|
||||
showOpenGLCrashNotification();
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "ui/gl/gl_shader.h"
|
||||
#include "media/streaming/media_streaming_common.h"
|
||||
#include "base/platform/base_platform_info.h"
|
||||
#include "core/crash_reports.h"
|
||||
#include "styles/style_media_view.h"
|
||||
|
||||
namespace Media::View {
|
||||
|
@ -119,6 +120,12 @@ void OverlayWidget::RendererGL::init(
|
|||
FragmentSampleARGB32Texture(),
|
||||
FragmentGlobalOpacity(),
|
||||
}));
|
||||
|
||||
const auto renderer = reinterpret_cast<const char*>(
|
||||
f.glGetString(GL_RENDERER));
|
||||
CrashReports::SetAnnotation(
|
||||
"OpenGL Renderer",
|
||||
renderer ? renderer : "[nullptr]");
|
||||
}
|
||||
|
||||
void OverlayWidget::RendererGL::deinit(
|
||||
|
|
|
@ -17,6 +17,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "core/file_utilities.h"
|
||||
#include "core/mime_type.h"
|
||||
#include "core/ui_integration.h"
|
||||
#include "core/crash_reports.h"
|
||||
#include "ui/widgets/popup_menu.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/image/image.h"
|
||||
|
@ -294,6 +295,8 @@ OverlayWidget::OverlayWidget()
|
|||
, _lastAction(-st::mediaviewDeltaFromLastAction, -st::mediaviewDeltaFromLastAction)
|
||||
, _stateAnimation([=](crl::time now) { return stateAnimationCallback(now); })
|
||||
, _dropdown(_widget, st::mediaviewDropdownMenu) {
|
||||
CrashReports::SetAnnotation("OpenGL Renderer", "[not-initialized]");
|
||||
|
||||
Lang::Updated(
|
||||
) | rpl::start_with_next([=] {
|
||||
refreshLang();
|
||||
|
|
Loading…
Add table
Reference in a new issue