diff options
author | Stephan Unverwerth <s.unverwerth@serenityos.org> | 2021-08-18 13:20:00 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-08-18 20:30:58 +0200 |
commit | 22905daacb2f48fa5f6764c22fc75f166fc9874e (patch) | |
tree | 37dffbf84df1ac138d8b520ef591839946eb251a /Userland/Libraries/LibGL/SoftwareRasterizer.cpp | |
parent | e9514cf6c04a389b5d6a3472a116c036c30fc8cd (diff) | |
download | serenity-22905daacb2f48fa5f6764c22fc75f166fc9874e.zip |
LibGL: Fix interpretation of BGRA byte order
This fixes byte order interpretation in several places.
Diffstat (limited to 'Userland/Libraries/LibGL/SoftwareRasterizer.cpp')
-rw-r--r-- | Userland/Libraries/LibGL/SoftwareRasterizer.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Libraries/LibGL/SoftwareRasterizer.cpp b/Userland/Libraries/LibGL/SoftwareRasterizer.cpp index c4d29f1135..e505ece5a3 100644 --- a/Userland/Libraries/LibGL/SoftwareRasterizer.cpp +++ b/Userland/Libraries/LibGL/SoftwareRasterizer.cpp @@ -35,15 +35,15 @@ static Gfx::RGBA32 to_rgba32(const FloatVector4& v) u8 g = clamped.y() * 255; u8 b = clamped.z() * 255; u8 a = clamped.w() * 255; - return a << 24 | b << 16 | g << 8 | r; + return a << 24 | r << 16 | g << 8 | b; } static FloatVector4 to_vec4(Gfx::RGBA32 rgba) { return { - (rgba & 0xff) / 255.0f, - ((rgba >> 8) & 0xff) / 255.0f, ((rgba >> 16) & 0xff) / 255.0f, + ((rgba >> 8) & 0xff) / 255.0f, + (rgba & 0xff) / 255.0f, ((rgba >> 24) & 0xff) / 255.0f }; } |