From e23e4c7c603fc1cd911621d0f833031be4a6f7c7 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 1 May 2015 18:25:29 +0200 Subject: cocoa: don't accidentally drop initial screen drawing With --idle --force-window, or when started from the bundle, the cocoa code dropped the first frame. This resulted in a black frame on start sometimes. The reason was that the live resizing/redrawing code was invoked, which simply set skip_swap_buffer to false, blocking redrawing whatever was going to be rendered next. Normally this is done so that the following works: 1. vo_opengl draw a frame, releases GL lock 2. live resizing kicks in, redraw the frame 3. vo_opengl wants to call SwapBuffers, drawing a stale buffer overwritten by the live resizing code This is solved by setting skip_swap_buffer in 2., and querying it in 3. Fix this by resetting the skip_swap_buffer at a known good point: when vo_opengl starts drawing a new frame. The start_frame function returns bool, so that it can be merged with is_active in a following commit. --- video/out/cocoa_common.h | 1 + 1 file changed, 1 insertion(+) (limited to 'video/out/cocoa_common.h') diff --git a/video/out/cocoa_common.h b/video/out/cocoa_common.h index 30792a674e..e2bed88d08 100644 --- a/video/out/cocoa_common.h +++ b/video/out/cocoa_common.h @@ -30,6 +30,7 @@ void vo_cocoa_uninit(struct vo *vo); int vo_cocoa_config_window(struct vo *vo, uint32_t flags, void *gl_ctx); void vo_cocoa_set_current_context(struct vo *vo, bool current); +bool vo_cocoa_start_frame(struct vo *vo); void vo_cocoa_swap_buffers(struct vo *vo); int vo_cocoa_check_events(struct vo *vo); int vo_cocoa_control(struct vo *vo, int *events, int request, void *arg); -- cgit v1.2.3