[Xquartz-dev] Porting XCopyArea to plain OS X

Platon Fomichev pfomichev at elverils.com
Wed May 13 02:25:00 PDT 2009

Dear Jeremy

Here is a bit more wordy explanation about what I am interested in:

First of all I am completely oblivious to internal X server code  
structure so please bare with me. What I am looking at is at xorg- 
server-1.4.2-apple42/hw/xquartz/xpr/xprFrame.c file where there is a  
pointer callback structure:
static RootlessFrameProcsRec xprRootlessProcs, where there is a  
xp_copy_bytes function supplied as an accelerated version for blitting  
stuff. All in all the code in xorg-server-1.4.2-apple42/hw/xquartz is  
heavily filled with xp_ funcs. So I guess the first question is - what  
code I should be looking at?

Next one is as follows: if not xp* funcs what technology do you use to  
blit fast to screen? I don't think you're allocating and dropping  
CImage's or something in that way - it's too slow, thus you're  
probably using something to do quick drawings and you can somehow get  
to the 'raw' pixel data for window backing store somehow. Am I right?  
If yes, how do you do this?

The last question was about not XCopyArea for X11 which is O.K. but  
about an analogue of XCopyArea written for OS X without any X11  
support. Suppose I am porting X11 application to pure OS X what can  
you advise me to use to emulate XCopyArea with source being the  
window. Here I desperately need your expertise because there does not  
seem to be a convinient way to do so on OS X (or may be I am mistaken).

Last question how do I get very quickly the bitmap bits for the  
particular window on screen? Getting it using Cocoa is very slow.  
Using QuickDraw is not an option.. So what to do?

Best regards,

More information about the Xquartz-dev mailing list