mirror of
https://github.com/TomHarte/CLK.git
synced 2024-12-27 01:31:42 +00:00
Merge pull request #246 from TomHarte/MainThreadBackingSize
Ensures self.bounds and -convertSizeToBacking: are called only on the main queue.
This commit is contained in:
commit
05a93ba237
@ -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];
|
||||
|
Loading…
Reference in New Issue
Block a user