WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
REOPENED
245446
[GTK] weird colours in WebKitGTK2+ browsers on OpenBSD (PowerPC, big endian, OpenGL)
https://bugs.webkit.org/show_bug.cgi?id=245446
Summary
[GTK] weird colours in WebKitGTK2+ browsers on OpenBSD (PowerPC, big endian, ...
Marco van Hulten
Reported
2022-09-20 13:13:07 PDT
Created
attachment 462477
[details]
w3.org website in Midori 9.0 Both with Midori and Badwolf rendering show strange rendering (see attached image). It looks like only one colour is used, but other webpages seem to use two colours. Since the problem occurs with two browsers using WebKitGTK, I made a (not very educated) guess to report the bug here. This is on an iMac G5 (PowerPC 970FX) with OpenBSD current (macppc port).
Attachments
w3.org website in Midori 9.0
(88.95 KB, image/png)
2022-09-20 13:13 PDT
,
Marco van Hulten
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Fujii Hironori
Comment 1
2022-09-20 13:34:59 PDT
Same problem with
bug#219916 comment#4
. WebKitGTK has USE_OPENGL_OR_ES build switch to disable OpenGL for minor operating systems which have a problem for OpenGL. WebKitGTK has WEBKIT_DISABLE_COMPOSITING_MODE env var to disable accelerated compositing.
https://trac.webkit.org/wiki/EnvironmentVariables
Fujii Hironori
Comment 2
2022-09-20 13:56:50 PDT
Looking at your screenshot. At least, it seems that red and blue are swapped. This is the color conversion matrix.
https://github.com/WebKit/WebKit/blob/9c06eb3162b5f48ee882984e91f8ac9d4f9f1fdd/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp#L435-L445
I think there are more problems. You might need some more swizzling in BitmapTextureGL::updateContents.
https://github.com/WebKit/WebKit/blob/main/Source/WebCore/platform/graphics/texmap/BitmapTextureGL.cpp#L91
Miguel Gomez
Comment 3
2022-09-21 00:31:04 PDT
Cairo uses ARGB32 as the color format for its surfaces. On little endian systems, this is stored as BGRA. When we upload the cairo surfaces into textures, we upload them as BGRA indicating that when painting them we will change that format to RGBA. The TextureMapperGL::ShouldConvertTextureBGRAToRGBA flag used in BitmapTextureGL::updateContents() takes care of that (by selecting the appropriate color conversion matrix that Fujii linked). On big endian systems, cairo contents are stored as ARGB. This means that when uploading the surface contents to textures, we should use the flag TextureMapperGL::ShouldConvertTextureARGBToRGBA, which doesn't seem to be used. Something like this in BitmapTextureGL::updateContents() should fix the color conversion on big endian. #if G_BYTE_ORDER == G_LITTLE_ENDIAN m_colorConvertFlags = TextureMapperGL::ShouldConvertTextureBGRAToRGBA; #else m_colorConvertFlags = TextureMapperGL::ShouldConvertTextureARGBToRGBA; #endif
Dennis Camera
Comment 4
2024-03-04 09:30:36 PST
I tested the patch suggested by Miguel Gomez and it corrects the colours when WEBKIT_DISABLE_COMPOSITING_MODE=1 is used. So I opened a PR with this change:
https://github.com/WebKit/WebKit/pull/25424
When accelerated compositing is used, at least on my system, black on white text is now displayed light gray on white instead of blue on white as before. Blue is yellow. I suspect that RGBA is confused as BARG.
EWS
Comment 5
2024-03-07 01:53:00 PST
Committed
275780@main
(c37138cb8d45): <
https://commits.webkit.org/275780@main
> Reviewed commits have been landed. Closing PR #25424 and removing active labels.
Dennis Camera
Comment 6
2024-03-07 02:19:31 PST
I think that this bug should be reopened, because the colours are only fixed in non-accelerated mode.
Michael Catanzaro
Comment 7
2024-03-07 06:03:03 PST
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug