History

Merge pull request #13308 from jherico/fix/13677

Fix for black text rendering white in web elements

Sam Gateau committed 8 years ago

Commit f769b632 parents e8ec32c e7e9ca41 file · +54 −38Browse files

Showing the changes to interface/src/Application.cpp (1 of 1 file). Show all

Unified · Split

interface/src/Application.cpp+54−38
@@ -2607,10 +2607,55 @@ void Application::initializeGL() { · 2606 unmodified lines
26072607 _isGLInitialized = true;
26082608 }
26092609
2610− _glWidget->makeCurrent();
2611− glClearColor(0.2f, 0.2f, 0.2f, 1);
2612− glClear(GL_COLOR_BUFFER_BIT);
2613− _glWidget->swapBuffers();
2610+ if (!_glWidget->makeCurrent()) {
2611+ qCWarning(interfaceapp, "Unable to make window context current");
2612+ }
2613+
2614+#if !defined(DISABLE_QML)
2615+ // Build a shared canvas / context for the Chromium processes
2616+ {
2617+ // Disable signed distance field font rendering on ATI/AMD GPUs, due to
2618+ // https://highfidelity.manuscript.com/f/cases/13677/Text-showing-up-white-on-Marketplace-app
2619+ std::string vendor{ (const char*)glGetString(GL_VENDOR) };
2620+ if ((vendor.find("AMD") != std::string::npos) || (vendor.find("ATI") != std::string::npos)) {
2621+ qputenv("QTWEBENGINE_CHROMIUM_FLAGS", QByteArray("--disable-distance-field-text"));
2622+ }
2623+
2624+ // Chromium rendering uses some GL functions that prevent nSight from capturing
2625+ // frames, so we only create the shared context if nsight is NOT active.
2626+ if (!nsightActive()) {
2627+ _chromiumShareContext = new OffscreenGLCanvas();
2628+ _chromiumShareContext->setObjectName("ChromiumShareContext");
2629+ _chromiumShareContext->create(_glWidget->qglContext());
2630+ if (!_chromiumShareContext->makeCurrent()) {
2631+ qCWarning(interfaceapp, "Unable to make chromium shared context current");
2632+ }
2633+ qt_gl_set_global_share_context(_chromiumShareContext->getContext());
2634+ _chromiumShareContext->doneCurrent();
2635+ // Restore the GL widget context
2636+ if (!_glWidget->makeCurrent()) {
2637+ qCWarning(interfaceapp, "Unable to make window context current");
2638+ }
2639+ } else {
2640+ qCWarning(interfaceapp) << "nSight detected, disabling chrome rendering";
2641+ }
2642+ }
2643+#endif
2644+
2645+ // Build a shared canvas / context for the QML rendering
2646+ {
2647+ _qmlShareContext = new OffscreenGLCanvas();
2648+ _qmlShareContext->setObjectName("QmlShareContext");
2649+ _qmlShareContext->create(_glWidget->qglContext());
2650+ if (!_qmlShareContext->makeCurrent()) {
2651+ qCWarning(interfaceapp, "Unable to make QML shared context current");
2652+ }
2653+ OffscreenQmlSurface::setSharedContext(_qmlShareContext->getContext());
2654+ _qmlShareContext->doneCurrent();
2655+ if (!_glWidget->makeCurrent()) {
2656+ qCWarning(interfaceapp, "Unable to make window context current");
2657+ }
2658+ }
26142659
26152660 // Build an offscreen GL context for the main thread.
26162661 _offscreenContext = new OffscreenGLCanvas();
@@ -2622,6 +2667,11 @@ void Application::initializeGL() { · 5 unmodified lines
26222667 _offscreenContext->doneCurrent();
26232668 _offscreenContext->setThreadContext();
26242669
2670+ _glWidget->makeCurrent();
2671+ glClearColor(0.2f, 0.2f, 0.2f, 1);
2672+ glClear(GL_COLOR_BUFFER_BIT);
2673+ _glWidget->swapBuffers();
2674+
26252675 // Move the GL widget context to the render event handler thread
26262676 _renderEventHandler = new RenderEventHandler(_glWidget->qglContext());
26272677 if (!_offscreenContext->makeCurrent()) {
@@ -2744,40 +2794,6 @@ extern void setupPreferences(); · 116 unmodified lines
27442794 static void addDisplayPluginToMenu(const DisplayPluginPointer& displayPlugin, int index, bool active = false);
27452795
27462796 void Application::initializeUi() {
2747− // Build a shared canvas / context for the Chromium processes
2748−#if !defined(DISABLE_QML)
2749− // Chromium rendering uses some GL functions that prevent nSight from capturing
2750− // frames, so we only create the shared context if nsight is NOT active.
2751− if (!nsightActive()) {
2752− _chromiumShareContext = new OffscreenGLCanvas();
2753− _chromiumShareContext->setObjectName("ChromiumShareContext");
2754− _chromiumShareContext->create(_offscreenContext->getContext());
2755− if (!_chromiumShareContext->makeCurrent()) {
2756− qCWarning(interfaceapp, "Unable to make chromium shared context current");
2757− }
2758− qt_gl_set_global_share_context(_chromiumShareContext->getContext());
2759− _chromiumShareContext->doneCurrent();
2760− // Restore the GL widget context
2761− _offscreenContext->makeCurrent();
2762− } else {
2763− qCWarning(interfaceapp) << "nSIGHT detected, disabling chrome rendering";
2764− }
2765−#endif
2766−
2767− // Build a shared canvas / context for the QML rendering
2768− _qmlShareContext = new OffscreenGLCanvas();
2769− _qmlShareContext->setObjectName("QmlShareContext");
2770− _qmlShareContext->create(_offscreenContext->getContext());
2771− if (!_qmlShareContext->makeCurrent()) {
2772− qCWarning(interfaceapp, "Unable to make QML shared context current");
2773− }
2774− OffscreenQmlSurface::setSharedContext(_qmlShareContext->getContext());
2775− _qmlShareContext->doneCurrent();
2776− // Restore the GL widget context
2777− _offscreenContext->makeCurrent();
2778− // Make sure all QML surfaces share the main thread GL context
2779− OffscreenQmlSurface::setSharedContext(_offscreenContext->getContext());
2780−
27812797 AddressBarDialog::registerType();
27822798 ErrorDialog::registerType();
27832799 LoginDialog::registerType();

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t