Skip to content

Commit

Permalink
[WebCore] Add big endian bitmap texture
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=245446

Reviewed by Michael Catanzaro and Miguel Gomez.

Adding the ARGB bitmap for big endian fixes colours when WEBKIT_DISABLE_COMPOSITING_MODE=1 is set.

* Source/WebCore/platform/graphics/texmap/BitmapTexture.cpp: add bitmap texture for big endian.

Canonical link: https://commits.webkit.org/275780@main
  • Loading branch information
Dennis Camera authored and magomez committed Mar 7, 2024
1 parent 290968e commit c37138c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Source/WebCore/platform/graphics/texmap/BitmapTexture.cpp
Expand Up @@ -86,7 +86,11 @@ void BitmapTexture::updateContents(const void* srcData, const IntRect& targetRec
// We are updating a texture with format RGBA with content from a buffer that has BGRA format. Instead of turning BGRA
// into RGBA and then uploading it, we upload it as is. This causes the texture format to be RGBA but the content to be BGRA,
// so we mark the texture to convert the colors when painting the texture.
#if CPU(LITTLE_ENDIAN)
m_colorConvertFlags = TextureMapperFlags::ShouldConvertTextureBGRAToRGBA;
#else
m_colorConvertFlags = TextureMapperFlags::ShouldConvertTextureARGBToRGBA;
#endif

glBindTexture(GL_TEXTURE_2D, m_id);

Expand Down

0 comments on commit c37138c

Please sign in to comment.