gnustep-dev
[Top][All Lists]
Advanced

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

Re: Backend functions


From: Fred Kiefer
Subject: Re: Backend functions
Date: Mon, 30 Apr 2001 01:39:23 +0200

Fred Kiefer wrote:
> Next I would like to move some of the implementation of the xgps drawing
> functions from the file XGDrawingEngine over to NSGraphicsContext. The
> xgps implementation uses DPS primitives to implement those functions so
> this implementation could be used as a fallback for all back ends,
> whereas back ends that are able to optimize this operation (as the xdps
> back end) will overwrite those methods. Of course, this would include
> the replacement of CUR_CONTEXT with self.
> For some of this functions (ok, they are now methods, but they have been
> functions for so long that I still think of them as such) this is not
> that easy as they use the gState to find out if the current view is
> flipped. For this I would like to introduce a new function (OK, once
> again a method) GSWViewFlipped. The standard implementation would get
> the locked view and check if it is flipped, xgps version would be
> optimized to ask the gState. The make this concept a bit cleared to the
> programmer, I would also like to rename GSWViewFliepped: into
> GSWSetViewFlipped:, this would have an empty standard implementation, as
> this is not really needed for subclasses.
> 

I did implement and commit those changes. Please check if anything is
still correct for you. Especially on the xdps backend, where I could not
check myself. For the xgps backend I removed all the methods that were
now identical to the implementation on the super class. I did not do
this for xdps, as I could not test this. I also moved the old text
functions into the frontend. There was never any reason to have them in
any backend.

While moving the code I also corrected some methods and implemented
NSDrawTiledRects. I think that this function should be at the heart of
all the button, bezel and groove functions. So perhaps we could drop all
the special implementations there and replace them with calls to
NSDrawTiledRects. This would allow us to make real functions out of all
these methods again, keeping only a few basic additions to the
PostScript operator (like NSRectFillListWithGrays). 
In the functions we would just list, which side would get which colours
in which order, making all those functions more maintainable. (Also
making all those missing functions so much easier) The difference will
be that instead of path operations buttons (and oll the others) would be
drawn via RectFill. 
The old question, of the performance impact of this change is hard to
answer. Perhaps, we should just try it and measure. I will experiment on
this the next days.

Fred




reply via email to

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