[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Opal, CGLayer and OpenGL in UIKit
From: |
Eric Wasylishen |
Subject: |
Re: Opal, CGLayer and OpenGL in UIKit |
Date: |
Fri, 30 Sep 2011 11:57:43 -0600 |
On 2011-09-30, at 11:00 AM, David Chisnall wrote:
> On 30 Sep 2011, at 17:48, Ivan Vučica wrote:
>
>> Hi,
>>
>> I've been reading the Apple docs on Quartz/CoreGraphics, and I've stumbled
>> upon CGLayer. Upon first look, it looks like CGLayer is already implemented.
>>
>> My first thought is that perhaps we don't need to actually use OpenGL when
>> implementing UIKit, at least not initially. What do you guys think?
>
> CGLayer is implemented, but it currently only does the very basic stuff. It
> currently uses a Cairo pattern to allow it to be composited. This works, but
> it's going to be fairly slow.
Right - but there's no need for my CGLayer implementation be slower than Quartz
- it's all up to cairo. It's worth looking into the cairo gl backend (not
released yet, afaik) - I've never tried it. I believe cairo is designed in such
a way so that cairo backends can easily provide fast paths for things like
drawing a source surface onto a destination.
> UIKit (and modern AppKit) do a lot more. For example, even the very basic
> swoosh effect as you slide a layer off the screen is going to require
> compositing the texture a few dozen times. This can be very fast in OpenGL,
> but is likely to be slow with Cairo. CoreAnimation wants to move layers
> around in 3D space (well, rotate them in 3D, move them in 2D), while
> CoreImage wants to run shader programs on them. All of these things are
> trivial with OpenGL, but very hard in Cairo.
>
> So, in theory it's possible, but in practice it will be hard.
>
On another topic, Ivan, did you look in to http://chameleonproject.org/? I
remember it was discussed before here. Personally, I think it would be cooler
to further develop gnustep-gui and integrate opal (and maybe write a core
animation implementation) such that chameleon can run on GNUstep, rather than
write another uikit implementation.
Cheers
Eric