1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-01-15 05:31:30 +00:00

Reinstated traditional drawing logic.

This commit is contained in:
Thomas Harte 2016-05-08 16:45:57 -04:00
parent ccdbec3ffc
commit 8ca3dfc9c5

View File

@ -60,7 +60,6 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeSt
BOOL didSkip = _hasSkipped;
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
[self.delegate openGLView:self didUpdateToTime:time didSkipPreviousUpdate:didSkip frequency:frequency];
[self drawViewOnlyIfDirty:YES];
OSAtomicTestAndClear(processingMask, &_updateIsOngoing);
});
_hasSkipped = NO;
@ -69,13 +68,13 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeSt
// Draw the display only if a previous draw is not still ongoing. -drawViewOnlyIfDirty: is guaranteed
// to be safe to call concurrently with -openGLView:updateToTime: so there's no need to worry about
// the above interrupting the below or vice versa.
// if(!OSAtomicTestAndSet(drawingMask, &_updateIsOngoing))
// {
// dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
// [self drawViewOnlyIfDirty:YES];
// OSAtomicTestAndClear(drawingMask, &_updateIsOngoing);
// });
// }
if(!OSAtomicTestAndSet(drawingMask, &_updateIsOngoing))
{
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
[self drawViewOnlyIfDirty:YES];
OSAtomicTestAndClear(drawingMask, &_updateIsOngoing);
});
}
}
- (void)invalidate
@ -135,7 +134,7 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeSt
- (void)drawRect:(NSRect)dirtyRect
{
// [self drawViewOnlyIfDirty:NO];
[self drawViewOnlyIfDirty:NO];
}
- (void)drawViewOnlyIfDirty:(BOOL)onlyIfDirty