OSDN Git Service

Bug 3158404 : Performance improvement for browser complex script handle.
authorclaireho <chinglanho@gmail.com>
Tue, 2 Nov 2010 21:26:59 +0000 (14:26 -0700)
committerclaireho <chinglanho@gmail.com>
Wed, 3 Nov 2010 17:56:04 +0000 (10:56 -0700)
commit5e45e11e0649161823ace17ca9e020111624a486
treec8e26eaacb53eb26c8783b58006dd7ce60a02635
parent48735f195bdb1f681dba8e1d67f0b85b9b74c1a8
Bug 3158404 : Performance improvement for browser complex script handle.

1. Reduce the number of calls of normalization function.
   The purpose of NFC normalization is to compose base letter and non-spacing
   combining marks to be accented character. i.e. Convert A(U+0041) and
   acute(U+0301) to A with Acute(U+00C1).
   NFC includes three parts - decomposition, canonical sort and composition
   for entire string. It is very expensive. TextRunWalker class would like
   to convert '\t', '\n' and non-break space(\U+00A0) to space.  NFC cannot
   achieve this purpose. So, it is not necessary to call normalization for
   Font::treatAsSpace().
   This improvement saves the NFC nomalization calls for complex script text
   has '\t', '\n' or 0xA0 and does not have non-spacing combining marks.
2. FontAndroid.cpp scans text for space and punctuation in 2 separate
   loops. Combine these 2 loops to one pass.

Change-Id: I6b1ff20dd1072cf1f03066ce1c87ad39d0040779
WebCore/platform/graphics/android/FontAndroid.cpp