[Webkit-unassigned] [Bug 245446] [GTK] weird colours in WebKitGTK2+ browsers on OpenBSD (PowerPC, big endian, OpenGL)

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Sep 21 00:31:04 PDT 2022


https://bugs.webkit.org/show_bug.cgi?id=245446

Miguel Gomez <magomez at igalia.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |magomez at igalia.com

--- Comment #3 from Miguel Gomez <magomez at igalia.com> ---
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

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220921/a5d04e0e/attachment.htm>


More information about the webkit-unassigned mailing list