discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: XCB (Was Re: Window managers ( was Re: newbie question ))


From: hns
Subject: Re: XCB (Was Re: Window managers ( was Re: newbie question ))
Date: Thu, 23 Apr 2009 22:43:30 -0700 (PDT)
User-agent: G2/1.0

On 23 Apr., 21:32, David Chisnall <thera...@sucs.org> wrote:
> On 23 Apr 2009, at 19:32, hns wrote:
>
> > Cairo uses Xrender, so should be very fast over a network.
>
> I theory, at least.  I am not convinced GNUstep's use of Cairo is  
> particularly efficient in this respect.  One thing I've suggested  
> before, which can have a big impact on speed (at the cost of some  
> memory, so good for remote display, not so good for mobile devices,  
> although the iPhone uses it extensively so perhaps the cost is not so  
> high with small screens / windows) is implementing CoreAnimation's  
> layer model in GNUstep back.  With OS X 10.5, individual views can opt  
> to have a layer associated with them.  This is an off-screen pixmap  
> for the view and when the layer containing that layer is drawn, it  
> simply composites the two together in the display server.  This is  
> very fast, for example, for drawing buttons, where you will have the  
> two states stored in different layers, and the button label stored in  
> a third.  For any button state, you just need to composite two of them  
> together and get the final result.  I believe when you do this with  
> the X11 back end, you send the two pixmaps to the server and then draw  
> them (and lose alpha), but when you do this with the Cairo back end  
> you composite them with the client, then send the resulting pixmap to  
> the server (using a blocking call, I believe, although I could be  
> wrong there).
>
> David

Are you sure that Cairo is doing any compositing on the client side?
If (but I don't know) it uses Xrender it will do all this exactly as
you described in the double buffered approach.
At least that is how I would expect it to work:

1. defining an NSImage (resp. NSBitmapImageRep) creates a Picture (an
off-screen buffer...) and sends the pixel data incl. alpha.
2. using (i.e. drawing) just tells the server where to compose the
Picture over another one (i.e. the screen)

So, drawing an image 100 times needs 1x sending data and 100x some
bytes to instruct the X-Server

Fred has a lot of experience how Cairo works (client or server side
compositing).

Nikolaus


reply via email to

[Prev in Thread] Current Thread [Next in Thread]