After a day brute force of using QCRenderer, an NSOpenGLView and a
pthread, all is working. There is a dramatic speed and performance
increase. I have to profile it but it is faster than I have ever
seen these compositions run.
In-editor performance is generally pretty bad, QC-wise (this is pretty
consistent with my experience as well, and goes all the way back to
Tiger) -- a lot of it possibly stems from running on the main thread
(along with event/UI handling, and lots of other things.) I've found
tying compositions to CVDisplayLinks to be absolutely fantastic, as
far as "holy crap this is gorgeous" goes -- it's a shame so many
people don't get to see their compositions that way.
The fact that QCCompositionLayer and QCView both render on the main
thread is a really big problem. If you only have one window, this
shouldn't be a problem. If you app is drawing in other places or
you have lots of controls that need updating, the main thread is
going to choke your Quartz Composition. I can't believe Apple
implemented it this way. If anything, it should run in its own
thread.
Do keep in mind that CoreAnimation is (was?) new to Leopard, and
QuartzComposer in Leopard was a pretty big step up from what was
available in Tiger. In light of that, it's easy to understand an
oversight like not handling threads nicely out of the box (after all,
QT is what, almost 20 years old, and _still_ doesn't play nicely with
threads without gobs of hand-holding?... it's like dealing with the
1980's, I swear) -- This is probably going to be addressed in a future
update/OS X release, if I had to guess (Apple's actually pretty good
about recommending threads where they make sense, and doing it
themselves in their own frameworks after they've been polished a
bit). For now, the workarounds aren't too impossible (as you've
demonstrated), so it's not as much of a priority I'd bet.
Apologetics aside, yes, main-thread rendering is a bad idea :)
The only thing I have to figure out is how to make it work in a
layer so I can take advantage of other CoreAnimaiton features.
CAOpenGLLayer, using the CGLContextObj? (totally grasping at straws,
but I think that's more or less the right direction)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/email@hidden
This email sent to email@hidden