Changeset 79174 in webkit


Ignore:
Timestamp:
Feb 20, 2011 8:37:38 PM (13 years ago)
Author:
tkent@chromium.org
Message:

2011-02-20 Sheriff Bot <webkit.review.bot@gmail.com>

Unreviewed, rolling out r79169.
http://trac.webkit.org/changeset/79169
https://bugs.webkit.org/show_bug.cgi?id=54846

Made unexpected results for tests without CJK characters
(Requested by tkent on #webkit).

  • platform/graphics/chromium/FontCacheChromiumWin.cpp: (WebCore::FontCache::createFontPlatformData):
  • platform/graphics/chromium/FontPlatformDataChromiumWin.cpp: (WebCore::FontPlatformData::FontPlatformData): (WebCore::FontPlatformData::operator=):
  • platform/graphics/chromium/FontPlatformDataChromiumWin.h: (WebCore::FontPlatformData::orientation):
  • platform/graphics/skia/FontCustomPlatformData.cpp: (WebCore::FontCustomPlatformData::fontPlatformData):
Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r79169 r79174  
     12011-02-20  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r79169.
     4        http://trac.webkit.org/changeset/79169
     5        https://bugs.webkit.org/show_bug.cgi?id=54846
     6
     7        Made unexpected results for tests without CJK characters
     8        (Requested by tkent on #webkit).
     9
     10        * platform/graphics/chromium/FontCacheChromiumWin.cpp:
     11        (WebCore::FontCache::createFontPlatformData):
     12        * platform/graphics/chromium/FontPlatformDataChromiumWin.cpp:
     13        (WebCore::FontPlatformData::FontPlatformData):
     14        (WebCore::FontPlatformData::operator=):
     15        * platform/graphics/chromium/FontPlatformDataChromiumWin.h:
     16        (WebCore::FontPlatformData::orientation):
     17        * platform/graphics/skia/FontCustomPlatformData.cpp:
     18        (WebCore::FontCustomPlatformData::fontPlatformData):
     19
    1202011-02-20  Chun-Lung Huang  <alvincl.huang@gmail.com>
    221
  • trunk/Source/WebCore/platform/graphics/chromium/FontCacheChromiumWin.cpp

    r79169 r79174  
    613613    FillLogFont(fontDescription, &winfont);
    614614
    615     // Take the orientation into consideration. For vertical: add "@" in front of the family name.
    616     // "@" is a built-in behaviour for Windows platform. http://msdn.microsoft.com/en-us/goglobal/bb688137
    617     // Try to create hfont with family name "@font-family-name".
    618     AtomicString updatedFamilyName;
    619     if (fontDescription.orientation() == Vertical && !family.startsWith("@") && !family.isEmpty())
    620         updatedFamilyName = "@" + String(family);
    621     else
    622         updatedFamilyName = family;
    623 
    624615    // Windows will always give us a valid pointer here, even if the face name
    625616    // is non-existent.  We have to double-check and see if the family name was
    626617    // really used.
    627618    String winName;
    628     HFONT hfont = createFontIndirectAndGetWinName(updatedFamilyName, &winfont, &winName);
     619    HFONT hfont = createFontIndirectAndGetWinName(family, &winfont, &winName);
    629620    if (!hfont)
    630621        return 0;
     
    632623    // FIXME: Do we need to use predefined fonts "guaranteed" to exist
    633624    // when we're running in layout-test mode?
    634     if (!equalIgnoringCase(updatedFamilyName, winName)) {
     625    if (!equalIgnoringCase(family, winName)) {
    635626        // For CJK fonts with both English and native names,
    636627        // GetTextFace returns a native name under the font's "locale"
     
    640631        // compare it with what's requested in the first place.
    641632        String altName;
    642         if (fontDescription.orientation() == Vertical) {
    643             if (!LookupAltName(family, altName) || !equalIgnoringCase("@" + altName, winName)) {
    644                 DeleteObject(hfont);
    645                 return 0;
    646             }
    647         } else {
    648             if (!LookupAltName(updatedFamilyName, altName) || !equalIgnoringCase(altName, winName)) {
    649                 DeleteObject(hfont);
    650                 return 0;
    651             }
     633        if (!LookupAltName(family, altName) ||
     634            !equalIgnoringCase(altName, winName)) {
     635            DeleteObject(hfont);
     636            return 0;
    652637        }
    653638    }
    654639
    655     return new FontPlatformData(hfont, fontDescription.computedPixelSize(), fontDescription.orientation());
    656 }
    657 
    658 }
     640    return new FontPlatformData(hfont,
     641                                fontDescription.computedPixelSize());
     642}
     643
     644}
  • trunk/Source/WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.cpp

    r79169 r79174  
    4747    , m_scriptCache(0)
    4848    , m_scriptFontProperties(0)
    49     , m_orientation(Horizontal)
    5049{
    5150}
     
    5655    , m_scriptCache(0)
    5756    , m_scriptFontProperties(0)
    58     , m_orientation(Horizontal)
    5957{
    6058}
    6159
    62 FontPlatformData::FontPlatformData(HFONT font, float size, FontOrientation orientation)
     60FontPlatformData::FontPlatformData(HFONT font, float size)
    6361    : m_font(RefCountedHFONT::create(font))
    6462    , m_size(size)
    6563    , m_scriptCache(0)
    6664    , m_scriptFontProperties(0)
    67     , m_orientation(orientation)
    6865{
    6966}
     
    7572    , m_scriptCache(0)
    7673    , m_scriptFontProperties(0)
    77     , m_orientation(Horizontal)
    7874{
    7975}
     
    8480    , m_scriptCache(0)
    8581    , m_scriptFontProperties(0)
    86     , m_orientation(Horizontal)
    8782{
    8883}
     
    9388        m_font = data.m_font;
    9489        m_size = data.m_size;
    95         m_orientation = data.m_orientation;
    9690
    9791        // The following fields will get re-computed if necessary.
  • trunk/Source/WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.h

    r79169 r79174  
    5858    FontPlatformData(WTF::HashTableDeletedValueType);
    5959    FontPlatformData();
    60     FontPlatformData(HFONT, float size, FontOrientation = Horizontal);
     60    FontPlatformData(HFONT, float size);
    6161    FontPlatformData(float size, bool bold, bool oblique);
    6262    FontPlatformData(const FontPlatformData&);
     
    7171    float size() const { return m_size; }
    7272
    73     FontOrientation orientation() const { return m_orientation; }
     73    FontOrientation orientation() const { return Horizontal; } // FIXME: Implement.
    7474
    7575    unsigned hash() const
     
    128128    RefPtr<RefCountedHFONT> m_font;
    129129    float m_size;  // Point size of the font in pixels.
    130     FontOrientation m_orientation;
    131130
    132131    mutable SCRIPT_CACHE m_scriptCache;
  • trunk/Source/WebCore/platform/graphics/skia/FontCustomPlatformData.cpp

    r79169 r79174  
    7979        return FontPlatformData();
    8080    }
    81 
    82     String newName;
    83     if (orientation == Vertical && !m_name.startsWith("@"))
    84         newName = "@" + m_name;
    85     else
    86         newName = m_name;
    87 
    88     memcpy(logFont.lfFaceName, newName.charactersWithNullTermination(), sizeof(logFont.lfFaceName[0]) * (1 + newName.length()));
     81    memcpy(logFont.lfFaceName, m_name.charactersWithNullTermination(),
     82           sizeof(logFont.lfFaceName[0]) * (1 + m_name.length()));
    8983
    9084    // FIXME: almost identical to FillLogFont in FontCacheWin.cpp.
     
    106100
    107101    HFONT hfont = CreateFontIndirect(&logFont);
    108     return FontPlatformData(hfont, size, orientation);
     102    return FontPlatformData(hfont, size);
    109103#elif OS(LINUX) || OS(FREEBSD) || PLATFORM(BREWMP)
    110104    ASSERT(m_fontReference);
Note: See TracChangeset for help on using the changeset viewer.