On Fri, Dec 13, 2002 at 04:54:38PM +0800, James Su wrote: > How about the memory layout? Could you please tell me how a surface > memory looks like? Does sub surface have its own buffer? > I don't understand the internal of surface. Could you please give me > some information?
A surface and a sub surface share the same CoreSurface structure. It holds information about the surfaces size, pixelformat, palette and so on. One CoreSurface can have one or two SurfaceBuffers (front and back). SurfaceBuffer structure contains the information about where and how the surface is laid out in memory (among other things). So a sub suface shares it's parents buffers. It just isn't allowed to touch the memory outside the specified rectangle. > >>Am I right? Then, for example if I > >>alloc a sub surface from an odd x coordination within the father > >>surface, i.e. (3,4), the memory offset of the sub surface will be 1.5 > >>bytes, but it's impossible! > > > >Perhaps you can simply return DFB_INVAREA in those cases. > > You mean, I just restrict the surface boundary at even coordination? But > I don't know if it's acceptable for user. Yes that's what I mean. If you want to handle odd coordinates it will complicate the software drawing code somewhat. Actually the software YUV code would also need some special odd coordinate handling but I didn't have any pressing need to do so because the usual operations are blit and clear for the whole surface. -- Ville Syrj�l� [EMAIL PROTECTED] http://www.sci.fi/~syrjala/ -- Info: To unsubscribe send a mail to [EMAIL PROTECTED] with "unsubscribe directfb-dev" as subject.
