[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
xji at chromium.org
xji at chromium.org
Wed Dec 22 13:53:32 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 888ccd459b60958e41f915cb6c946c5c975e73de
Author: xji at chromium.org <xji at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Sep 28 22:43:11 2010 +0000
Performance improvement for FontLinux.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68586 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/platform/graphics/chromium/FontLinux.cpp b/WebCore/platform/graphics/chromium/FontLinux.cpp
index d235dc3..cb066bd 100644
--- a/WebCore/platform/graphics/chromium/FontLinux.cpp
+++ b/WebCore/platform/graphics/chromium/FontLinux.cpp
@@ -485,12 +485,13 @@ private:
m_xPositions = new SkScalar[size];
m_item.num_glyphs = size;
- m_glyphsArraySize = size; // Save the GlyphArrays size.
- resetGlyphArrays(m_glyphsArraySize);
+ m_glyphsArrayCapacity = size; // Save the GlyphArrays size.
+ resetGlyphArrays();
}
- void resetGlyphArrays(int size)
+ void resetGlyphArrays()
{
+ int size = m_item.num_glyphs;
// All the types here don't have pointers. It is safe to reset to
// zero unless Harfbuzz breaks the compatibility in the future.
memset(m_item.glyphs, 0, size * sizeof(HB_Glyph));
@@ -503,10 +504,12 @@ private:
void shapeGlyphs()
{
- // Reset the array limit becuase HB_ShapeItem() overrides the
- // m_item.num_glyphs.
- m_item.num_glyphs = m_glyphsArraySize;
- resetGlyphArrays(m_glyphsArraySize);
+ // HB_ShapeItem() resets m_item.num_glyphs. If the previous call to
+ // HB_ShapeItem() used less space than was available, the capacity of
+ // the array may be larger than the current value of m_item.num_glyphs.
+ // So, we need to reset the num_glyphs to the capacity of the array.
+ m_item.num_glyphs = m_glyphsArrayCapacity;
+ resetGlyphArrays();
while (!HB_ShapeItem(&m_item)) {
// We overflowed our arrays. Resize and retry.
// HB_ShapeItem fills in m_item.num_glyphs with the needed size.
@@ -608,7 +611,7 @@ private:
unsigned m_offsetX; // Offset in pixels to the start of the next script run.
unsigned m_pixelWidth; // Width (in px) of the current script run.
unsigned m_numCodePoints; // Code points in current script run.
- unsigned m_glyphsArraySize; // Current size of all the Harfbuzz arrays.
+ unsigned m_glyphsArrayCapacity; // Current size of all the Harfbuzz arrays.
OwnPtr<TextRun> m_normalizedRun;
OwnArrayPtr<UChar> m_normalizedBuffer; // A buffer for normalized run.
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list