Attention is currently required from: Angel Pons, Nico Huber.
Hello Nico Huber,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/libgfxinit/+/81854?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed: Code-Review+1 by Nico Huber
Change subject: gfxtest: Introduce `From_RGBA` constructor for `Pixel_Type` ......................................................................
gfxtest: Introduce `From_RGBA` constructor for `Pixel_Type`
The `Pixel_Type` record uses a different order for its components, as the hardware expects the data bytes in BGRA order but most people are used to RGBA order for color components. However, this approach makes the compiler complain:
warning: component clause out of order with respect to declaration [-gnatw_r]
This prevents building gfxtest since the warning gets promoted to an error. While the issue is easy to work around (use BGRA order in the declaration), *having* to work around this problem is most certainly not ideal.
Introduce the `From_RGBA` function which maps 3 or 4 RGB(A) bytes to a `Pixel_Type` record. Alpha is optional for convenience, as most of the pixel handling uses fully opaque colors anyway.
Use this new function to replace positional aggregate initialization to preserve colors (red is red, blue is blue). Omitting `255` alphas makes up for the (slightly) increased verbosity of the code.
TEST=Run this and make sure all builds pass:
for f in configs/* do make distclean make DEBUG=1 cnf=$f gfx_test -j$(nproc) done
Change-Id: I77dbdcd6c235e411585585779c31777adcef57d0 Signed-off-by: Angel Pons th3fanbus@gmail.com --- M gfxtest/hw-gfx-gma-gfx_test.adb 1 file changed, 13 insertions(+), 17 deletions(-)
git pull ssh://review.coreboot.org:29418/libgfxinit refs/changes/54/81854/2