From 04bb49c1f682b66a138bf16b0cd7032992db5894 Mon Sep 17 00:00:00 2001 From: k1o0 Date: Fri, 4 Sep 2020 11:10:37 +0300 Subject: [PATCH 1/2] Issue #199 Virtual framebuffer to reduce missed FillRect --- +hw/+ptb/Window.m | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/+hw/+ptb/Window.m b/+hw/+ptb/Window.m index 24753d7c..70e3f870 100644 --- a/+hw/+ptb/Window.m +++ b/+hw/+ptb/Window.m @@ -49,6 +49,9 @@ % When true test synchronization to retrace upon open. Defaults to % global preference (usually true). See 'Screen SkipSyncTests?' PtbSyncTests + % When on, the PsychImaging pipeline is activated and a virtual + % framebuffer is used + VirtualFramebuffer matlab.lang.OnOffSwitchState = 'off' end properties (SetAccess = protected) @@ -283,8 +286,15 @@ function open(obj) % Perhaps this shouldn't be set after setting 'Verbosity'? % setup screen window - obj.PtbHandle = Screen('OpenWindow', obj.ScreenNum, obj.BackgroundColour,... - obj.OpenBounds, obj.PxDepth); + if obj.VirtualFramebuffer == "on" + PsychImaging('PrepareConfiguration'); + PsychImaging('AddTask', 'General', 'UseVirtualFramebuffer'); + obj.PtbHandle = PsychImaging('OpenWindow', ... + obj.ScreenNum, obj.BackgroundColour, obj.OpenBounds, obj.PxDepth); + else + obj.PtbHandle = Screen('OpenWindow', ... + obj.ScreenNum, obj.BackgroundColour, obj.OpenBounds, obj.PxDepth); + end obj.PxDepth = Screen('PixelSize', obj.PtbHandle); obj.Bounds = Screen('Rect', obj.PtbHandle); From d55b738fb79d4720acaec17b7dd9001490e95191 Mon Sep 17 00:00:00 2001 From: k1o0 Date: Tue, 8 Sep 2020 23:56:46 +0300 Subject: [PATCH 2/2] Inline comment --- +hw/+ptb/Window.m | 1 + alyx-matlab | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/+hw/+ptb/Window.m b/+hw/+ptb/Window.m index 70e3f870..0a1a5eed 100644 --- a/+hw/+ptb/Window.m +++ b/+hw/+ptb/Window.m @@ -287,6 +287,7 @@ function open(obj) % setup screen window if obj.VirtualFramebuffer == "on" + % Enable imaging pipeline and virtual framebuffer PsychImaging('PrepareConfiguration'); PsychImaging('AddTask', 'General', 'UseVirtualFramebuffer'); obj.PtbHandle = PsychImaging('OpenWindow', ... diff --git a/alyx-matlab b/alyx-matlab index 3df7cef8..d81f0cba 160000 --- a/alyx-matlab +++ b/alyx-matlab @@ -1 +1 @@ -Subproject commit 3df7cef88dee66c738d81c8aea6783f08884c85e +Subproject commit d81f0cba0d2ed525798d966aa1c6c0c8723bb509