<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#ffffff" text="#000000">
Maybe for Etoys, too?<br>
I saw a speedup from 8026 to 7558 with about 10 windows open.<br>
What do others think ?<br>
Karl<br>
<br>
-------- Original Message --------
<table class="moz-email-headers-table" border="0" cellpadding="0"
cellspacing="0">
<tbody>
<tr>
<th align="RIGHT" nowrap="nowrap" valign="BASELINE">Subject: </th>
<td>[squeak-dev] Fwd: A little font rendering speedup</td>
</tr>
<tr>
<th align="RIGHT" nowrap="nowrap" valign="BASELINE">Date: </th>
<td>Sun, 19 Apr 2009 16:36:19 +0300</td>
</tr>
<tr>
<th align="RIGHT" nowrap="nowrap" valign="BASELINE">From: </th>
<td>Igor Stasenko <a class="moz-txt-link-rfc2396E" href="mailto:siguctua@gmail.com"><siguctua@gmail.com></a></td>
</tr>
<tr>
<th align="RIGHT" nowrap="nowrap" valign="BASELINE">Reply-To: </th>
<td>The general-purpose Squeak developers list
<a class="moz-txt-link-rfc2396E" href="mailto:squeak-dev@lists.squeakfoundation.org"><squeak-dev@lists.squeakfoundation.org></a></td>
</tr>
<tr>
<th align="RIGHT" nowrap="nowrap" valign="BASELINE">To: </th>
<td>The general-purpose Squeak developers list
<a class="moz-txt-link-rfc2396E" href="mailto:squeak-dev@lists.squeakfoundation.org"><squeak-dev@lists.squeakfoundation.org></a>, Pharo Development
<a class="moz-txt-link-rfc2396E" href="mailto:Pharo-project@lists.gforge.inria.fr"><Pharo-project@lists.gforge.inria.fr></a></td>
</tr>
</tbody>
</table>
<br>
<br>
<pre>I put this on mantis, since i'm sure this applies to squeak3.10 and Pharo both.
<a class="moz-txt-link-freetext" href="http://bugs.squeak.org/view.php?id=7338">http://bugs.squeak.org/view.php?id=7338</a>
---------- Forwarded message ----------
From: Igor Stasenko <a class="moz-txt-link-rfc2396E" href="mailto:siguctua@gmail.com"><siguctua@gmail.com></a>
Date: 2009/4/19
Subject: A little font rendering speedup
To: Pharo Development <a class="moz-txt-link-rfc2396E" href="mailto:Pharo-project@lists.gforge.inria.fr"><Pharo-project@lists.gforge.inria.fr></a>
This is an image-side change, which makes a primitiveDisplayString to
not fail because StrikeFontSet returns nil for (font
characterToGlyphMap).
Since the code, which using fast primitive looks like following:
self primDisplayString: aString from: startIndex to: stopIndex
map: font characterToGlyphMap xTable: font xTable
kern: kernDelta
I thought, why one would return nil in ( font characterToGlyphMap ).
Since #xTable in StrikeFontSet implemented as following:
xTable
"Answer an Array of the left x-coordinate of characters in glyphs."
^ (fontArray at: 1) xTable.
i think it is safe to do similar in characterToGlyphMap ,
this allows the primitive to work w/o failure, because otherwise, if
you look at implementation of
primDisplayString: aString from: startIndex to: stopIndex map:
glyphMap xTable: xTable kern: kernDelta
in fallback code it does same thing again (and ignoring glyphMap at all, btw).
To bench a difference, leave a couple of windows with text in world and then do:
[10 timesRepeat: [World fullDrawOn: World assuredCanvas] ] timeToRun
before change:
645
after change:
545
--
Best regards,
Igor Stasenko AKA sig.
</pre>
</body>
</html>