1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-05 10:28:58 +00:00

Ensures self.bounds and -convertSizeToBacking: are called only on the main queue.

This commit is contained in:
Thomas Harte 2017-09-20 19:59:34 -04:00
parent b85dd608e7
commit 77548d14db

View File

@ -15,6 +15,7 @@
@implementation CSOpenGLView {
CVDisplayLinkRef _displayLink;
CGSize _backingSize;
}
- (void)prepareOpenGL
@ -68,12 +69,17 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeSt
- (CGSize)backingSize
{
return [self convertSizeToBacking:self.bounds.size];
@synchronized(self) {
return _backingSize;
}
}
- (void)reshape
{
[super reshape];
@synchronized(self) {
_backingSize = [self convertSizeToBacking:self.bounds.size];
}
[self performWithGLContext:^{
CGSize viewSize = [self backingSize];