gnustep-dev
[Top][All Lists]
Advanced

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

Re: New libart/freetype-based backend


From: Adam Fedor
Subject: Re: New libart/freetype-based backend
Date: Sun, 14 Apr 2002 21:12:32 -0600
User-agent: Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:0.9.8) Gecko/20020310

Alexander Malmberg wrote:
Disadvantages are:
- It's slower than xgps (but still fast enough to use), and uses more
memory (double backing store: both the gsc/ stuff and the internal
buffer).

Well sorry to change the graphics interface on you, but I just commited change that does this...

I though it was odd to have to use both -contextDevice: and DPSsetgcdrawable:::: to setup the graphics context with the correct drawable, so I combined these both into:

- (void) GSSetDevice: (void*)device : (int)x : (int)y;

where device is (currently) a gswindow_device_t pointer (so you can get all the info you need quickly). I also added an informal protocol for communication between the window server and graphics drivers that handle backing store, so you might implement in the graphics driver:

- (void) GSSetDevice: (void*)device : (int)x : (int)y
{
  gswindow_device_t *gswin = device;

  window = gswin->ident;

  /* Tell the server we will do backing */
gswin->gdriverProtocol = (GSDriverHandlesBacking | GSDriverHandlesExpose);

  /* Insert a pointer to our backing device handler */
  gswin->gdriver = mywindriver;
}


Then when the window needs to be flushed or exposed, you will receive a message where you can flush the window:

+ (void) handleExposeRect: (NSRect)rect forDriver: (void *)driver
{
   MyWinDriver *wd = (MyWindDriver *)driver;
   [wd flushRect: rect];
}

I think this interface is really just temporary to help you work on the graphics part and see how fast it can be without having to double-buffer, but in fact this interface makes it nearly impossible to have more than one context draw into a window (say, if you had an NSOpenGLView). It also forces the graphics driver to know lots of stuff about the window server (like is it X11 or Windows). Eventually we will have to agree on a common buffer format which you can write to and the window server can read which is server independant (if that's possible - it may not be if we want decent graphics performace).






--
Adam Fedor, Digital Optics Corp.      | I'm glad I hate spinach, because
http://www.doc.com                    | if I didn't, I'd eat it, and you
                                      | know how I hate the stuff.




reply via email to

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