Fix bad glClearColor parameters

Container spec indicates that background color is written
in BGRA byte order, but glClearColor() parameters are RGBA.
Anyway the checkerboard is displayed right after glClear()
calls so it replaces background color.

In response to webp-discuss/TkLHALGaHaM

Change-Id: Ief5435fadfd6a422b881a9dc240b5e8dc6546e19
This commit is contained in:
Yannis Guyon 2018-07-18 10:36:19 +02:00
parent da96d8d9ab
commit 78ad57a36a

View File

@ -408,9 +408,9 @@ static void StartDisplay(void) {
glutKeyboardFunc(HandleKey); glutKeyboardFunc(HandleKey);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND); glEnable(GL_BLEND);
glClearColor(GetColorf(kParams.bg_color, 0), glClearColor(GetColorf(kParams.bg_color, 16), // BGRA from spec
GetColorf(kParams.bg_color, 8), GetColorf(kParams.bg_color, 8),
GetColorf(kParams.bg_color, 16), GetColorf(kParams.bg_color, 0),
GetColorf(kParams.bg_color, 24)); GetColorf(kParams.bg_color, 24));
glClear(GL_COLOR_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT);
DrawCheckerBoard(); DrawCheckerBoard();