DevTools Dark mode does not render chrome properly on NVidia PRIME setups

Description of the issue:
When switching to dark mode in the devtools, the text does not render properly. I have GPU rendering turned on in Brave, and have a PRIME GPU (Intel + NVidia). When I start the browser on the NVidia card, it renders fine, but the GPU acceleration for some sites, like google meet (esp. background effects) does not work in this mode.

I have another computer that only renders to an NVidia GPU, and it also renders fine.

I have included a screencast to show exactly what is happening.

Selecting dark mode in devtools does not render text properly

How can this issue be reproduced?

  1. Start Brave on a PRIME-enabled device (most likely a laptop)
  2. Open devtools
  3. set the theme to “Dark”

Expected result:
All text renders and is readable.

Brave Version( check About Brave):
1.39.122

(could you also make it easier to copy the version string?)

Additional Information:
The other tools display fine, just not the devtools’ chrome:
more devtool dark mode
As you can see, the bottom panel, Rendering is displaying text incorrectly, as well as all the tabs, but the contents seem to be OK.

Just spitballing here but have you tried fooling with your font AA to see if it fixes things? Maybe something whacky going on with subpixel ordering when contrasted against the dark theme for a specific font or font size. Maybe try a different hint strength or subpixel geometry settings.

Also does this persist if you set to dark, close and reopen it?

I tried every combination of anti-aliasing I could. None of those settings seem to affect Brave at all.

Well I did say spitballing but it was worth a shot. Seems these days it’s a non-stop flood of UI regressions or security “fixes” that just break legit functionality. Not too long ago the dev tools ignored the dark theme completely…so baby steps with lots of trips…

FWIW, I checked this in other chrome-based browsers (Chrome, Vivaldi, and Ungoogled Chrome) and they all exhibited the same bug. I am going to try a few other tests (different desktop environments and compositors) and see if that make any difference. I recently uncovered a few bugs in GNOME-Shell, about the same time as this bug, so I am beginning to suspect it may be the compositor in gnome-shell.

Yeah this is the problem with the benevolent benefactor world we live in. No one can afford to develop their own thing so in the case of all the Chrome based browsers they are subject to all the idiotic decisions Google makes and all the bugs “features” they inject.

Sadly no different in the Firefox world other than they do it to themselves. UI changes no one asked for, breaking what works and taking away user choice.

1 Like

I tried a bunch of different things, and I couldn’t fix the problem, however, I did notice some errors on brave://gpu/ every time I open the devtools:

[16545:16545:0618/233043.665403:INFO:SkTypeface_remote.cpp(77)] : GlyphCacheMiss generateFontMetrics: Rec textsize 0x1.a66666p+3 prescale 0x1p+0 preskew 0x0p+0 post [0x1p+0 0x0p+0 0x0p+0 0x1p+0] frame -1 miter 0 format 4 join 0 cap 0 flags 0x27a4 lum bits ffffffff, device gamma 76, paint gamma 76 contrast 51 foreground color 0
[16545:16545:0618/233043.665490:INFO:SkTypeface_remote.cpp(30)] : GlyphCacheMiss generateMetrics looking for glyph: d8 generateMetrics: Rec textsize 0x1.a66666p+3 prescale 0x1p+0 preskew 0x0p+0 post [0x1p+0 0x0p+0 0x0p+0 0x1p+0] frame -1 miter 0 format 4 join 0 cap 0 flags 0x27a4 lum bits ffffffff, device gamma 76, paint gamma 76 contrast 51 foreground color 0
[16545:16545:0618/233043.665571:INFO:SkTypeface_remote.cpp(30)] : GlyphCacheMiss generateMetrics looking for glyph: 148 generateMetrics: Rec textsize 0x1.a66666p+3 prescale 0x1p+0 preskew 0x0p+0 post [0x1p+0 0x0p+0 0x0p+0 0x1p+0] frame -1 miter 0 format 4 join 0 cap 0 flags 0x27a4 lum bits ffffffff, device gamma 76, paint gamma 76 contrast 51 foreground color 0

where the last error is repeated for about 10 more glyphs.