[comp.sys.mac.programmer] CDEF question

mikeoro@hubcap.clemson.edu (Michael K O'Rourke) (12/16/89)

I am finishing up a CDEF that i have created and have a question about the
draw routine for the CDEF.

Is it very advantageous to reset the ClipRgn to be the area of my control when
it redraws itself?  Will that actually speed things up?  If so, is it even 
better to set the clipRgn to the intersection of the old clip and my control?

Currently I do the latter, but i don't know if this is really that   
advantageous or possibly detremental to the performance of my CDEF.

Thanx,
Michael

oster@dewey.soe.berkeley.edu (David Phillip Oster) (12/19/89)

In article <7470@hubcap.clemson.edu> mikeoro@hubcap.clemson.edu (Michael K O'Rourke) writes:
>Is it very advantageous to reset the ClipRgn to be the area of my control when
>it redraws itself?  Will that actually speed things up?  If so, is it even 
>better to set the clipRgn to the intersection of the old clip and my control?

The fastest thing is to leave the clipRgn alone. If you have to change it,
because your CDEF would draw out of bounds otherwise, you must change it
to the intersection of its old value and what you want. If the CDEF just
stores into the clipRgn, it will screw up the caller  -- the reason the
caller set a small cliprgn is because the caller wanted to restrict where
your CDEF could draw.  Naturally, no matter what changes the CDEF makes to
the clipRgn, it must restore it to what it was on entry.

> The mac is a detour in the inevitable march of mediocre computers.
> drs@bnlux0.bnl.gov (David R. Stampf)
--- David Phillip Oster          -master of the ad hoc odd hack. 
Arpa: oster@dewey.soe.berkeley.edu 
Uucp: {uwvax,decvax}!ucbvax!oster%dewey.soe.berkeley.edu