From c10a493cafd2c0f7cb4ad9d5bf183ff7cc126cfa Mon Sep 17 00:00:00 2001 From: James Zern Date: Sat, 25 Nov 2017 18:21:44 -0800 Subject: [PATCH] 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 --- examples/vwebp.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/examples/vwebp.c b/examples/vwebp.c index 6376e563..b19465cd 100644 --- a/examples/vwebp.c +++ b/examples/vwebp.c @@ -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);