Skip to content

Commit

Permalink
cocoa: re-enable double buffering
Browse files Browse the repository at this point in the history
This causes a performance regression on 10.11 and newer, but the single
buffered method was broken and could cause partially rendered frames to
be presented to the screen.

This reverts 9f30cd8 and
e543853.
  • Loading branch information
rossy authored and haasn committed Sep 17, 2017
1 parent 14131fe commit b7062e9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 2 additions & 0 deletions video/out/cocoa_common.m
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,8 @@ void vo_cocoa_swap_buffers(struct vo *vo)
}
pthread_mutex_unlock(&s->sync_lock);

CGLFlushDrawable(s->cgl_ctx);

pthread_mutex_lock(&s->lock);
s->frame_w = vo->dwidth;
s->frame_h = vo->dheight;
Expand Down
4 changes: 1 addition & 3 deletions video/out/opengl/context_cocoa.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ static CGLError test_gl_version(struct ra_ctx *ctx, CGLOpenGLProfile ver)
// rejected attribute to preserve the fallback code
kCGLPFAOpenGLProfile,
(CGLPixelFormatAttribute) ver,
kCGLPFADoubleBuffer,
kCGLPFAAccelerated,
kCGLPFAAllowOfflineRenderers,
// keep this one last to apply the cocoa-force-dedicated-gpu option
Expand Down Expand Up @@ -196,10 +197,7 @@ static int cocoa_control(struct ra_ctx *ctx, int *events, int request,
static void cocoa_swap_buffers(struct ra_ctx *ctx)
{
struct priv *p = ctx->priv;
GL *gl = &p->gl;

vo_cocoa_swap_buffers(ctx->vo);
gl->Flush();
ra_gl_ctx_post_swap_buffers(ctx);
}

Expand Down

0 comments on commit b7062e9

Please sign in to comment.