diff options
author | Sven Gothel <[email protected]> | 2012-02-13 14:27:53 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-02-13 14:27:53 +0100 |
commit | be91765959db646cca0b03537f140da9fecd7450 (patch) | |
tree | 211429df09b040018641b45751d0e721c716d330 /src/jogl | |
parent | f2bc8fe1f93b5a112093d9507bdb397e3b390215 (diff) |
OSX CALayer fix for Java7 (force CALayer to 0/0, always remove all animations)
Diffstat (limited to 'src/jogl')
-rw-r--r-- | src/jogl/native/macosx/MacOSXWindowSystemInterface-pbuffer.m | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/jogl/native/macosx/MacOSXWindowSystemInterface-pbuffer.m b/src/jogl/native/macosx/MacOSXWindowSystemInterface-pbuffer.m index b713465f7..6071f9610 100644 --- a/src/jogl/native/macosx/MacOSXWindowSystemInterface-pbuffer.m +++ b/src/jogl/native/macosx/MacOSXWindowSystemInterface-pbuffer.m @@ -102,9 +102,23 @@ static CVReturn renderMyNSOpenGLLayer(CVDisplayLinkRef displayLink, pthread_mutex_init(&renderLock, &renderLockAttr); // recursive pthread_cond_init(&renderSignal, NULL); // no attribute + textureID = 0; + swapInterval = -1; + shallDraw = NO; + texWidth = _texWidth; + texHeight = _texHeight; pbuffer = p; [pbuffer retain]; + { + CGRect lRect = CGRectMake(0, 0, texWidth, texHeight); + [self setFrame:lRect]; + + // no animations for add/remove/swap sublayers etc + // doesn't work: [self removeAnimationForKey: kCAOnOrderIn, kCAOnOrderOut, kCATransition] + [self removeAllAnimations]; + } + // instantiate a deactivated displayLink #ifdef HAS_CADisplayLink displayLink = [[CVDisplayLink displayLinkWithTarget:self selector:@selector(setNeedsDisplay)] retain]; @@ -148,12 +162,8 @@ static CVReturn renderMyNSOpenGLLayer(CVDisplayLinkRef displayLink, [self setAsynchronous: YES]; [self setNeedsDisplayOnBoundsChange: YES]; // FIXME: learn how to recreate on size change! + [self setOpaque: opaque ? YES : NO]; - texWidth = _texWidth; - texHeight = _texHeight; - textureID = 0; - swapInterval = -1; - shallDraw = NO; CGRect lRect = [self frame]; DBG_PRINT("MyNSOpenGLLayer::init %p, ctx %p, pfmt %p, pbuffer %p, opaque %d, pbuffer %dx%d -> tex %dx%d, frame: %lf/%lf %lfx%lf (refcnt %d)\n", |