From 4a579ad16694da158c641514b39a1547fe6c7449 Mon Sep 17 00:00:00 2001 From: Akemi Date: Sat, 17 Feb 2018 01:12:05 +0100 Subject: [PATCH] cocoa-cb: fix hwdec when drawing off-screen drawing off-screen failed because we didn't have a valid context. the problem is we force off-screen drawing because the CAOpenGLLayer refuses to draw anything while being off-screen. set the current context before starting to draw anything off-screen. Fixes #5530 --- video/out/cocoa-cb/video_layer.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/video/out/cocoa-cb/video_layer.swift b/video/out/cocoa-cb/video_layer.swift index 05f0894159..ed259d04f5 100644 --- a/video/out/cocoa-cb/video_layer.swift +++ b/video/out/cocoa-cb/video_layer.swift @@ -198,6 +198,7 @@ class VideoLayer: CAOpenGLLayer { if !cocoaCB.window.occlusionState.contains(.visible) && neededFlips > 1 && canDrawOffScreen { + CGLSetCurrentContext(cglContext!) draw(cglContext!) display() } else {