Reputation: 18122
I want to swap out one view with another by pushing the old view aside to slide in a new view (the kCATransitionPush type). To use CoreAnimation I need to work with CALayers with my views. The problem is that attaching a backing layer to my window content view through setWantsLayer distorts everything in the view.
I'm not sure if this has something to do with the fact that I'm using a subclass of NSWindow called MAAttachedWindow (http://mattgemmell.com/source), which is a HUD style transparent popup window of sorts that attaches to another element on the screen.
I can provide screenshots of this distortion if needed. I got the animation working through NSViewAnimation, but as many others have experienced, NSViewAnimation is terribly slow. I'd rather use CoreAnimation but this issue prevents me from using it.
Any insight is greatly appreciated
Upvotes: 2
Views: 986
Reputation: 972
In addition to possibility of non-integral coordinates, to me the text appears to have been drawn into a non-opaque buffer. The LCD-aware Quartz text antialiasing doesn't work if it is drawn atop a non-opaque background color and then composited. Rather, your layer/view must fill the background with an opaque background color and then draw text above it.
One workaround for this that we've played with is to:
The issue with the scroller is possibly that the scroller is claiming -isOpaque but it isn't. Appropriate twiddling of the opaqueness and background color rendering should help.
Upvotes: 1
Reputation: 4004
Looking at how distortion increases makes me think that one or more of your views' bounds or frame are not integral.
Upvotes: 0
Reputation: 61228
Given your saying the problem doesn't occur with normal windows, it's time to hawk-eye MAAttachedWindow. One of the first things I see when the window is created in this code is:
[self useOptimizedDrawing:YES];
What happens if you comment that line out? The next thing to look at is the drawing code. Also, the -_redisplay method disables/reenables screen updates, updating geometry and the background while this occurs. All of this would make me suspicious of its interaction with layer-backed views and animation.
Upvotes: 0