mirror of
https://github.com/TomHarte/CLK.git
synced 2024-09-08 03:54:27 +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 {
|
@implementation CSOpenGLView {
|
||||||
CVDisplayLinkRef _displayLink;
|
CVDisplayLinkRef _displayLink;
|
||||||
|
CGSize _backingSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)prepareOpenGL
|
- (void)prepareOpenGL
|
||||||
@ -68,12 +69,17 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeSt
|
|||||||
|
|
||||||
- (CGSize)backingSize
|
- (CGSize)backingSize
|
||||||
{
|
{
|
||||||
return [self convertSizeToBacking:self.bounds.size];
|
@synchronized(self) {
|
||||||
|
return _backingSize;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)reshape
|
- (void)reshape
|
||||||
{
|
{
|
||||||
[super reshape];
|
[super reshape];
|
||||||
|
@synchronized(self) {
|
||||||
|
_backingSize = [self convertSizeToBacking:self.bounds.size];
|
||||||
|
}
|
||||||
|
|
||||||
[self performWithGLContext:^{
|
[self performWithGLContext:^{
|
||||||
CGSize viewSize = [self backingSize];
|
CGSize viewSize = [self backingSize];
|
||||||
|
Loading…
Reference in New Issue
Block a user