Colored TTF rendering

Diego Gomez Deck DiegoGomezDeck at consultar.com
Wed Nov 15 09:21:22 UTC 2006


Hi,

A just made a quick try[*] and it seems to work.

I tried the CS in 3.9-7067 and I got this numbers:

   Before: 5782
   After: 539

I also tried in a 3.8 with a lot of packages (the image I'm currently
using for development) and the number are more impressive:

   Before: 12405
   After: 541

Attached is the CS.

Cheers,

-- Diego

[*] I only filed out the changeset created my Monticello in the
installation of Multilingual-ar.17.mcz. This changeset seems to be in
good order.

> Diego Gomez Deck wrote:
> > Do you have any code snippet to test (an compare) the TTF rendering
> > speed?
> 
> Sure. Try this:
> 
> text :=
> 	('Hello World\' withCRs asText addAttribute: TextColor red),
> 	('Hello World\' withCRs asText addAttribute: TextColor green),
> 	('Hello World\' withCRs asText addAttribute: TextColor blue).
> text addAttribute: (TextFontReference toFont:
> 	((TextStyle named: 'BitstreamVeraSans') fontOfSize: 24)).
> morph := TextMorph new contentsAsIs: text.
> form := Form extent: morph fullBounds extent depth: 32.
> Transcript cr; show: (
>    [1 to: 1000 do:[:i| morph fullDrawOn: form getCanvas]] timeToRun
> ).
> 
> On my machine this results in:
> 	Before: 8700 msecs
> 	After:   750 msecs
> And the speed difference is actually quite noticeable in interactions.
> 
> Cheers,
>    - Andreas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: TTFSpeedUp-dgd.1.cs.gz
Type: application/x-gzip
Size: 2654 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20061115/8cfaa0aa/TTFSpeedUp-dgd.1.cs.bin


More information about the Squeak-dev mailing list