From 32f3d479907254d11219c112bd6a5529e714ea5b Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 9 Apr 2019 12:44:04 +0200 Subject: Image draw: Fix/workaround image corruption on draw Was mainly visible with high-res image. Not entirely clear why it is only happening on macOS. While the entire function should be re-written to make float images displayed faster, still nice to fix the drawing. Reviewers: fclem Reviewed By: fclem Differential Revision: https://developer.blender.org/D4664 --- source/blender/editors/screen/glutil.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source/blender/editors') diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c index 230d6179871..4dc3b24c309 100644 --- a/source/blender/editors/screen/glutil.c +++ b/source/blender/editors/screen/glutil.c @@ -286,6 +286,13 @@ void immDrawPixelsTexScaled_clipping(IMMDrawPixelsTexState *state, immAttr2f(texco, (float)(0 + offset_left) / tex_w, (float)(subpart_h - offset_top) / tex_h); immVertex2f(pos, rast_x + (float)offset_left * xzoom, rast_y + (float)(subpart_h - offset_top) * yzoom * scaleY); immEnd(); + + /* NOTE: Weirdly enough this is only required on macOS. Without this there is some sort of + * bleeding of data is happening from tiles which are drawn later on. + * This doesn't seem to be too slow, but still would be nice to have fast and nice solution. */ +#ifdef __APPLE__ + glFlush(); +#endif } } -- cgit v1.2.3