summaryrefslogtreecommitdiffstats
path: root/video/out/mac/metal_layer.swift
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:13:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:13:14 +0000
commit60e8a3d404f0640fa5a3f834eae54b4f1fb9127d (patch)
tree1da89a218d0ecf010c67a87cb2f625c4cb18e7d7 /video/out/mac/metal_layer.swift
parentAdding upstream version 0.37.0. (diff)
downloadmpv-upstream.tar.xz
mpv-upstream.zip
Adding upstream version 0.38.0.upstream/0.38.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'video/out/mac/metal_layer.swift')
-rw-r--r--video/out/mac/metal_layer.swift12
1 files changed, 12 insertions, 0 deletions
diff --git a/video/out/mac/metal_layer.swift b/video/out/mac/metal_layer.swift
index 7cea87c..7fc419a 100644
--- a/video/out/mac/metal_layer.swift
+++ b/video/out/mac/metal_layer.swift
@@ -16,10 +16,22 @@
*/
import Cocoa
+import QuartzCore
class MetalLayer: CAMetalLayer {
unowned var common: MacCommon
+ // workaround for a MoltenVK workaround that sets the drawableSize to 1x1 to forcefully complete
+ // the presentation, this causes flicker and the drawableSize possibly staying at 1x1
+ override var drawableSize: CGSize {
+ get { return super.drawableSize }
+ set {
+ if Int(newValue.width) > 1 && Int(newValue.height) > 1 {
+ super.drawableSize = newValue
+ }
+ }
+ }
+
init(common com: MacCommon) {
common = com
super.init()