[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

darin darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 05:57:32 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit c931f4034f3b869ec487996667e35db95ae7a1cb
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Mar 15 18:30:53 2002 +0000

            Some more optimizations. Carves another 6% or so off of NSView.html.
    
            * src/kwq/KWQChar.mm: (QChar::QChar): Handle characters > 0x7F correctly.
            (QChar::cell): Remove unnecessary & operation.
            (QChar::row): Remove unnecessary & operation.
            (QChar::latin1): Do a simpler check rather than calling row().
            (QChar::operator char): Do the same work as latin1 inline.
            (operator==) (operator!=), (operator>=), (operator>), (operator<=), (operator<):
            Handle characters > 0x7F correctly.
    
            * src/kwq/KWQFontMetrics.mm: (QFontMetrics::ascent), (QFontMetrics::descent):
            Cache the ascent and descent rather than computing it each time we are called.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@749 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index a1c534a..6df890a 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,5 +1,20 @@
 2002-03-15  Darin Adler  <darin at apple.com>
 
+	Some more optimizations. Carves another 6% or so off of NSView.html.
+
+	* src/kwq/KWQChar.mm: (QChar::QChar): Handle characters > 0x7F correctly.
+	(QChar::cell): Remove unnecessary & operation.
+	(QChar::row): Remove unnecessary & operation.
+	(QChar::latin1): Do a simpler check rather than calling row().
+	(QChar::operator char): Do the same work as latin1 inline.
+	(operator==) (operator!=), (operator>=), (operator>), (operator<=), (operator<):
+	Handle characters > 0x7F correctly.
+
+	* src/kwq/KWQFontMetrics.mm: (QFontMetrics::ascent), (QFontMetrics::descent):
+	Cache the ascent and descent rather than computing it each time we are called.
+
+2002-03-15  Darin Adler  <darin at apple.com>
+
 	Optimizations for creating empty QFont objects, measuring certain single
 	characters, and copying QFontMetrics objects. Makes loading NSView.html about
 	18% faster.
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index a1c534a..6df890a 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,5 +1,20 @@
 2002-03-15  Darin Adler  <darin at apple.com>
 
+	Some more optimizations. Carves another 6% or so off of NSView.html.
+
+	* src/kwq/KWQChar.mm: (QChar::QChar): Handle characters > 0x7F correctly.
+	(QChar::cell): Remove unnecessary & operation.
+	(QChar::row): Remove unnecessary & operation.
+	(QChar::latin1): Do a simpler check rather than calling row().
+	(QChar::operator char): Do the same work as latin1 inline.
+	(operator==) (operator!=), (operator>=), (operator>), (operator<=), (operator<):
+	Handle characters > 0x7F correctly.
+
+	* src/kwq/KWQFontMetrics.mm: (QFontMetrics::ascent), (QFontMetrics::descent):
+	Cache the ascent and descent rather than computing it each time we are called.
+
+2002-03-15  Darin Adler  <darin at apple.com>
+
 	Optimizations for creating empty QFont objects, measuring certain single
 	characters, and copying QFontMetrics objects. Makes loading NSView.html about
 	18% faster.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index a1c534a..6df890a 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,5 +1,20 @@
 2002-03-15  Darin Adler  <darin at apple.com>
 
+	Some more optimizations. Carves another 6% or so off of NSView.html.
+
+	* src/kwq/KWQChar.mm: (QChar::QChar): Handle characters > 0x7F correctly.
+	(QChar::cell): Remove unnecessary & operation.
+	(QChar::row): Remove unnecessary & operation.
+	(QChar::latin1): Do a simpler check rather than calling row().
+	(QChar::operator char): Do the same work as latin1 inline.
+	(operator==) (operator!=), (operator>=), (operator>), (operator<=), (operator<):
+	Handle characters > 0x7F correctly.
+
+	* src/kwq/KWQFontMetrics.mm: (QFontMetrics::ascent), (QFontMetrics::descent):
+	Cache the ascent and descent rather than computing it each time we are called.
+
+2002-03-15  Darin Adler  <darin at apple.com>
+
 	Optimizations for creating empty QFont objects, measuring certain single
 	characters, and copying QFontMetrics objects. Makes loading NSView.html about
 	18% faster.
diff --git a/WebCore/kwq/KWQChar.mm b/WebCore/kwq/KWQChar.mm
index b4722b8..9b7a3e1 100644
--- a/WebCore/kwq/KWQChar.mm
+++ b/WebCore/kwq/KWQChar.mm
@@ -61,7 +61,7 @@ QChar::QChar()
 
 QChar::QChar(char ch)
 {
-    c = ch;
+    c = (uchar) ch;
 }
 
 QChar::QChar(uchar uch)
@@ -111,23 +111,23 @@ ushort QChar::unicode() const
 uchar QChar::cell() const
 {
     // return least significant byte
-    return c & 0xff;
+    return c;
 }
 
 uchar QChar::row() const
 {
     // return most significant byte
-    return (c & 0xff00) >> 8;
+    return c >> 8;
 }
 
 char QChar::latin1() const
 {
-    return row() ? 0 : cell();
+    return c > 0xff ? 0 : c;
 }
 
 QChar::operator char() const
 {
-    return latin1();
+    return c > 0xff ? 0 : c;
 }
 
 bool QChar::isNull() const
@@ -139,7 +139,7 @@ bool QChar::isSpace() const
 {
     // FIXME: should we use this optimization?
 #if 0
-    if (!row()) {
+    if (c <= 0xff) {
 	return isspace(c);
     }
 #endif
@@ -245,12 +245,12 @@ bool operator==(QChar qc1, QChar qc2)
 
 bool operator==(QChar qc, char ch)
 {
-    return qc.c == ch;
+    return qc.c == (uchar) ch;
 }
 
 bool operator==(char ch, QChar qc)
 {
-    return ch == qc.c;
+    return (uchar) ch == qc.c;
 }
 
 bool operator!=(QChar qc1, QChar qc2)
@@ -260,12 +260,12 @@ bool operator!=(QChar qc1, QChar qc2)
 
 bool operator!=(QChar qc, char ch)
 {
-    return qc.c != ch;
+    return qc.c != (uchar) ch;
 }
 
 bool operator!=(char ch, QChar qc)
 {
-    return ch != qc.c;
+    return (uchar) ch != qc.c;
 }
 
 bool operator>=(QChar qc1, QChar qc2)
@@ -275,12 +275,12 @@ bool operator>=(QChar qc1, QChar qc2)
 
 bool operator>=(QChar qc, char ch)
 {
-    return qc.c >= ch;
+    return qc.c >= (uchar) ch;
 }
 
 bool operator>=(char ch, QChar qc)
 {
-    return ch >= qc.c;
+    return (uchar) ch >= qc.c;
 }
 
 bool operator>(QChar qc1, QChar qc2)
@@ -295,7 +295,7 @@ bool operator>(QChar qc, char ch)
 
 bool operator>(char ch, QChar qc)
 {
-    return ch > qc.c;
+    return (uchar) ch > qc.c;
 }
 
 bool operator<=(QChar qc1, QChar qc2)
@@ -305,12 +305,12 @@ bool operator<=(QChar qc1, QChar qc2)
 
 bool operator<=(QChar qc, char ch)
 {
-    return qc.c <= ch;
+    return qc.c <= (uchar) ch;
 }
 
 bool operator<=(char ch, QChar qc)
 {
-    return ch <= qc.c;
+    return (uchar) ch <= qc.c;
 }
 
 bool operator<(QChar qc1, QChar qc2)
@@ -320,12 +320,12 @@ bool operator<(QChar qc1, QChar qc2)
 
 bool operator<(QChar qc, char ch)
 {
-    return qc.c < ch;
+    return qc.c < (uchar) ch;
 }
 
 bool operator<(char ch, QChar qc)
 {
-    return ch < qc.c;
+    return (uchar) ch < qc.c;
 }
 
 #endif  // _KWQ_QCHAR_INLINES_
diff --git a/WebCore/kwq/KWQFontMetrics.mm b/WebCore/kwq/KWQFontMetrics.mm
index 9d7280f..7216a61 100644
--- a/WebCore/kwq/KWQFontMetrics.mm
+++ b/WebCore/kwq/KWQFontMetrics.mm
@@ -312,6 +312,8 @@ struct QFontMetricsPrivate {
         info = [[KWQLayoutInfo getMetricsForFont: aFont] retain];
         spaceWidth = -1;
         xWidth = -1;
+        ascent = -1;
+        descent = -1;
     }
     ~QFontMetricsPrivate()
     {
@@ -323,6 +325,8 @@ struct QFontMetricsPrivate {
     NSFont *font;
     int spaceWidth;
     int xWidth;
+    int ascent;
+    int descent;
 };
 
 QFontMetrics::QFontMetrics()
@@ -356,12 +360,16 @@ int QFontMetrics::baselineOffset() const
 
 int QFontMetrics::ascent() const
 {
-    return ROUND_TO_INT([data->font ascender]);
+    if (data->ascent < 0)
+        data->ascent = ROUND_TO_INT([data->font ascender]);
+    return data->ascent;
 }
 
 int QFontMetrics::descent() const
 {
-    return ROUND_TO_INT(-[data->font descender]);
+    if (data->descent < 0)
+        data->descent = ROUND_TO_INT([data->font descender]);
+    return data->descent;
 }
 
 int QFontMetrics::height() const
diff --git a/WebCore/src/kwq/KWQChar.mm b/WebCore/src/kwq/KWQChar.mm
index b4722b8..9b7a3e1 100644
--- a/WebCore/src/kwq/KWQChar.mm
+++ b/WebCore/src/kwq/KWQChar.mm
@@ -61,7 +61,7 @@ QChar::QChar()
 
 QChar::QChar(char ch)
 {
-    c = ch;
+    c = (uchar) ch;
 }
 
 QChar::QChar(uchar uch)
@@ -111,23 +111,23 @@ ushort QChar::unicode() const
 uchar QChar::cell() const
 {
     // return least significant byte
-    return c & 0xff;
+    return c;
 }
 
 uchar QChar::row() const
 {
     // return most significant byte
-    return (c & 0xff00) >> 8;
+    return c >> 8;
 }
 
 char QChar::latin1() const
 {
-    return row() ? 0 : cell();
+    return c > 0xff ? 0 : c;
 }
 
 QChar::operator char() const
 {
-    return latin1();
+    return c > 0xff ? 0 : c;
 }
 
 bool QChar::isNull() const
@@ -139,7 +139,7 @@ bool QChar::isSpace() const
 {
     // FIXME: should we use this optimization?
 #if 0
-    if (!row()) {
+    if (c <= 0xff) {
 	return isspace(c);
     }
 #endif
@@ -245,12 +245,12 @@ bool operator==(QChar qc1, QChar qc2)
 
 bool operator==(QChar qc, char ch)
 {
-    return qc.c == ch;
+    return qc.c == (uchar) ch;
 }
 
 bool operator==(char ch, QChar qc)
 {
-    return ch == qc.c;
+    return (uchar) ch == qc.c;
 }
 
 bool operator!=(QChar qc1, QChar qc2)
@@ -260,12 +260,12 @@ bool operator!=(QChar qc1, QChar qc2)
 
 bool operator!=(QChar qc, char ch)
 {
-    return qc.c != ch;
+    return qc.c != (uchar) ch;
 }
 
 bool operator!=(char ch, QChar qc)
 {
-    return ch != qc.c;
+    return (uchar) ch != qc.c;
 }
 
 bool operator>=(QChar qc1, QChar qc2)
@@ -275,12 +275,12 @@ bool operator>=(QChar qc1, QChar qc2)
 
 bool operator>=(QChar qc, char ch)
 {
-    return qc.c >= ch;
+    return qc.c >= (uchar) ch;
 }
 
 bool operator>=(char ch, QChar qc)
 {
-    return ch >= qc.c;
+    return (uchar) ch >= qc.c;
 }
 
 bool operator>(QChar qc1, QChar qc2)
@@ -295,7 +295,7 @@ bool operator>(QChar qc, char ch)
 
 bool operator>(char ch, QChar qc)
 {
-    return ch > qc.c;
+    return (uchar) ch > qc.c;
 }
 
 bool operator<=(QChar qc1, QChar qc2)
@@ -305,12 +305,12 @@ bool operator<=(QChar qc1, QChar qc2)
 
 bool operator<=(QChar qc, char ch)
 {
-    return qc.c <= ch;
+    return qc.c <= (uchar) ch;
 }
 
 bool operator<=(char ch, QChar qc)
 {
-    return ch <= qc.c;
+    return (uchar) ch <= qc.c;
 }
 
 bool operator<(QChar qc1, QChar qc2)
@@ -320,12 +320,12 @@ bool operator<(QChar qc1, QChar qc2)
 
 bool operator<(QChar qc, char ch)
 {
-    return qc.c < ch;
+    return qc.c < (uchar) ch;
 }
 
 bool operator<(char ch, QChar qc)
 {
-    return ch < qc.c;
+    return (uchar) ch < qc.c;
 }
 
 #endif  // _KWQ_QCHAR_INLINES_
diff --git a/WebCore/src/kwq/KWQFontMetrics.mm b/WebCore/src/kwq/KWQFontMetrics.mm
index 9d7280f..7216a61 100644
--- a/WebCore/src/kwq/KWQFontMetrics.mm
+++ b/WebCore/src/kwq/KWQFontMetrics.mm
@@ -312,6 +312,8 @@ struct QFontMetricsPrivate {
         info = [[KWQLayoutInfo getMetricsForFont: aFont] retain];
         spaceWidth = -1;
         xWidth = -1;
+        ascent = -1;
+        descent = -1;
     }
     ~QFontMetricsPrivate()
     {
@@ -323,6 +325,8 @@ struct QFontMetricsPrivate {
     NSFont *font;
     int spaceWidth;
     int xWidth;
+    int ascent;
+    int descent;
 };
 
 QFontMetrics::QFontMetrics()
@@ -356,12 +360,16 @@ int QFontMetrics::baselineOffset() const
 
 int QFontMetrics::ascent() const
 {
-    return ROUND_TO_INT([data->font ascender]);
+    if (data->ascent < 0)
+        data->ascent = ROUND_TO_INT([data->font ascender]);
+    return data->ascent;
 }
 
 int QFontMetrics::descent() const
 {
-    return ROUND_TO_INT(-[data->font descender]);
+    if (data->descent < 0)
+        data->descent = ROUND_TO_INT([data->font descender]);
+    return data->descent;
 }
 
 int QFontMetrics::height() const

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list