2010-04-28 Evan Martin <evan@chromium.org>
authorevan@chromium.org <evan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Apr 2010 00:38:40 +0000 (00:38 +0000)
committerevan@chromium.org <evan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Apr 2010 00:38:40 +0000 (00:38 +0000)
        Reviewed by David Levin.

        [chromium] revert getFontDataForCharacters change in r58341
        https://bugs.webkit.org/show_bug.cgi?id=38288

        * platform/chromium/test_expectations.txt: add the test to the now-failing list.
2010-04-28  Evan Martin  <evan@chromium.org>

        Reviewed by David Levin.

        [chromium] revert getFontDataForCharacters change in r58341
        https://bugs.webkit.org/show_bug.cgi?id=38288

        It caused a performance regression.

        * platform/chromium/ChromiumBridge.h:
        * platform/graphics/chromium/FontCacheLinux.cpp:
        (WebCore::FontCache::getFontDataForCharacters):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@58447 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/chromium/test_expectations.txt
WebCore/ChangeLog
WebCore/platform/chromium/ChromiumBridge.h
WebCore/platform/graphics/chromium/FontCacheLinux.cpp

index caaee2c..7692336 100644 (file)
@@ -1,3 +1,12 @@
+2010-04-28  Evan Martin  <evan@chromium.org>
+
+        Reviewed by David Levin.
+
+        [chromium] revert getFontDataForCharacters change in r58341
+        https://bugs.webkit.org/show_bug.cgi?id=38288
+
+        * platform/chromium/test_expectations.txt: add the test to the now-failing list.
+
 2010-04-28  Eric Seidel  <eric@webkit.org>
 
         Unreviewed, rolling out r58441.
index f1f52e4..b8d8b81 100644 (file)
@@ -2868,3 +2868,7 @@ BUGWK38108 MAC : fast/backgrounds/size/contain-and-cover.html = IMAGE
 
 // WebKit roll 58304:58400
 BUGUKAI WIN MAC : fast/text/international/bold-bengali.html = MISSING
+
+// We're reverting the patch that fixed this test on Linux due to
+// the perf regression described in the bug.
+BUG42760 LINUX : fast/text/international/bold-bengali.html = FAIL
index e143a2d..d8bbfda 100644 (file)
@@ -1,3 +1,16 @@
+2010-04-28  Evan Martin  <evan@chromium.org>
+
+        Reviewed by David Levin.
+
+        [chromium] revert getFontDataForCharacters change in r58341
+        https://bugs.webkit.org/show_bug.cgi?id=38288
+
+        It caused a performance regression.
+
+        * platform/chromium/ChromiumBridge.h:
+        * platform/graphics/chromium/FontCacheLinux.cpp:
+        (WebCore::FontCache::getFontDataForCharacters):
+
 2010-04-28  Eric Seidel  <eric@webkit.org>
 
         Unreviewed, rolling out r58441.
index 1f0040d..e582241 100644 (file)
@@ -116,8 +116,6 @@ namespace WebCore {
 #endif
 #if OS(LINUX)
         static void getRenderStyleForStrike(const char* family, int sizeAndStyle, FontRenderStyle* result);
-        // This code is currently in the process of getting rejiggered, and though
-        // it is not currently used, it will hopefully be used again soon.
         static String getFontFamilyForCharacters(const UChar*, size_t numCharacters);
 #endif
 
index b37e1c7..ececd13 100644 (file)
@@ -58,27 +58,12 @@ const SimpleFontData* FontCache::getFontDataForCharacters(const Font& font,
                                                           const UChar* characters,
                                                           int length)
 {
-    int style = SkTypeface::kNormal;
-    if (font.fontDescription().weight() >= FontWeightBold)
-        style |= SkTypeface::kBold;
-    if (font.fontDescription().italic())
-        style |= SkTypeface::kItalic;
-
-    SkTypeface* tf = SkTypeface::CreateForChars(characters, length * 2,
-                                                static_cast<SkTypeface::Style>(style));
-    if (!tf)
+    String family = ChromiumBridge::getFontFamilyForCharacters(characters, length);
+    if (family.isEmpty())
         return 0;
 
-    // FIXME: we don't have a family name for this font.
-    // However, the family name within FontPlatformData is only used when picking
-    // a render style for the font, so it's not too great of a loss.
-    FontPlatformData result(tf,
-                            "",
-                            font.fontDescription().computedSize(),
-                            (style & SkTypeface::kBold) && !tf->isBold(),
-                            (style & SkTypeface::kItalic) && !tf->isItalic());
-    tf->unref();
-    return getCachedFontData(&result);
+    AtomicString atomicFamily(family);
+    return getCachedFontData(getCachedFontPlatformData(font.fontDescription(), atomicFamily, false));
 }
 
 SimpleFontData* FontCache::getSimilarFontPlatformData(const Font& font)