vwebp: disable double buffering on windows & mac

this results in flickering with animated webp + alpha. disabling the
option is a workaround to restore the behavior to the previous release.

BUG=webp:365

Change-Id: Iac7fcc0d483837e76cc54ad3f26c4e0e5511e31d
This commit is contained in:
James Zern 2017-11-25 18:21:44 -08:00
parent 0d4466c2b4
commit c10a493caf

View File

@ -378,13 +378,23 @@ static void HandleDisplay(void) {
}
}
glPopMatrix();
#if defined(__APPLE__) || defined(_WIN32)
glFlush();
#else
glutSwapBuffers();
#endif
}
static void StartDisplay(void) {
const int width = kParams.canvas_width;
const int height = kParams.canvas_height;
// TODO(webp:365) GLUT_DOUBLE results in flickering / old frames to be
// partially displayed with animated webp + alpha.
#if defined(__APPLE__) || defined(_WIN32)
glutInitDisplayMode(GLUT_RGBA);
#else
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA);
#endif
glutInitWindowSize(width, height);
glutCreateWindow("WebP viewer");
glutDisplayFunc(HandleDisplay);