[ENH] GrafPort>>frameRect
Eddie Cottongim
cottonsqueak at earthlink.net
Mon Jun 23 19:21:47 UTC 2003
I noticed that Form>>border:width:rule:fillColor: does the same thing as
GrafPort>>frameRect and has a faster implementation, so I made a workalike
for GrafPort. This is a common operation used for things like borders in
Morphic.
Here is a summary of the speed differences, produced by the code below.
200 100 50 25 "width&height"
2290 2015 1868 1805 "old ms"
1484 1215 1077 1018 "new ms"
size := 100.
r := Rectangle origin: 100 at 100 extent: size at size.
d := Display getCanvas.
c := Color black.
t := Time
lisecondsToRun:[
10000 timesRepeat:[d frameRectangle: r width: 2 color: c]
].
Of course, we don't want several implementations of the same functions floating around, so it would be nice if these implementations had a real home. Theres a lot of duplication between the Form, Bitblt, Canvas, etc hierarchies.
Let me know if you see any problems.
Thanks,
Eddie
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GrafPort-frameRect-efc.1.cs.gz
Type: application/octet-stream
Size: 517 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20030623/4ca1e1d6/GrafPort-frameRect-efc.1.cs.obj
More information about the Squeak-dev
mailing list
|