Changeset 122255 in webkit


Ignore:
Timestamp:
Jul 10, 2012 1:30:01 PM (12 years ago)
Author:
wangxianzhu@chromium.org
Message:

[Chromium-Android] Use default font rendering styles in FontPlatformData::querySystemForRenderStyle()
https://bugs.webkit.org/show_bug.cgi?id=90826

Reviewed by Adam Barth.

Source/WebCore:

No new tests. The change to this file is refactoring only.

  • platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp:

(WebCore::FontPlatformData::querySystemForRenderStyle): Moved the "NoPreference" initialization into PlatformSupport::PlatformSupport::getRenderStyleForStrike().

Source/WebKit/chromium:

  • WebKit.gyp:
  • src/PlatformSupport.cpp:

(WebCore::PlatformSupport::getRenderStyleForStrike): Call style.setDefault() on Android or when the font is not specified.

Location:
trunk/Source
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r122253 r122255  
     12012-07-10  Xianzhu Wang  <wangxianzhu@chromium.org>
     2
     3        [Chromium-Android] Use default font rendering styles in FontPlatformData::querySystemForRenderStyle()
     4        https://bugs.webkit.org/show_bug.cgi?id=90826
     5
     6        Reviewed by Adam Barth.
     7
     8        No new tests. The change to this file is refactoring only.
     9
     10        * platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp:
     11        (WebCore::FontPlatformData::querySystemForRenderStyle): Moved the "NoPreference" initialization into PlatformSupport::PlatformSupport::getRenderStyleForStrike().
     12
    1132012-07-10  Raymond Toy  <rtoy@google.com>
    214
  • trunk/Source/WebCore/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp

    r120543 r122255  
    262262void FontPlatformData::querySystemForRenderStyle()
    263263{
    264     if (!m_family.length()) {
    265         // We don't have a family for this, probably because it's a webfont. We
    266         // set all the values to 'no preference' and take the system defaults.
    267         m_style.useBitmaps = FontRenderStyle::NoPreference;
    268         m_style.useAutoHint = FontRenderStyle::NoPreference;
    269         m_style.useHinting = FontRenderStyle::NoPreference;
    270         m_style.useAntiAlias = FontRenderStyle::NoPreference;
    271         m_style.useSubpixelRendering = FontRenderStyle::NoPreference;
    272         m_style.useSubpixelPositioning = FontRenderStyle::NoPreference;
    273         return;
    274     }
    275 
    276264    PlatformSupport::getRenderStyleForStrike(m_family.data(), (((int)m_textSize) << 2) | (m_typeface->style() & 3), &m_style);
    277265}
  • trunk/Source/WebKit/chromium/ChangeLog

    r122252 r122255  
     12012-07-10  Xianzhu Wang  <wangxianzhu@chromium.org>
     2
     3        [Chromium-Android] Use default font rendering styles in FontPlatformData::querySystemForRenderStyle()
     4        https://bugs.webkit.org/show_bug.cgi?id=90826
     5
     6        Reviewed by Adam Barth.
     7
     8        * WebKit.gyp:
     9        * src/PlatformSupport.cpp:
     10        (WebCore::PlatformSupport::getRenderStyleForStrike): Call style.setDefault() on Android or when the font is not specified.
     11
    1122012-07-10  Dana Jansens  <danakj@chromium.org>
    213
  • trunk/Source/WebKit/chromium/WebKit.gyp

    r121922 r122255  
    865865                    'sources/': [
    866866                        ['include', '^src/linux/WebFontRendering\\.cpp$'],
     867                        ['include', '^src/linux/WebFontRenderStyle\\.cpp$'],
    867868                    ],
    868869                }],
  • trunk/Source/WebKit/chromium/src/PlatformSupport.cpp

    r121212 r122255  
    6969#if OS(DARWIN)
    7070#include <public/mac/WebThemeEngine.h>
    71 #elif OS(UNIX) && !OS(ANDROID)
     71#elif OS(UNIX)
     72#include "WebFontRenderStyle.h"
     73#if OS(ANDROID)
     74#include <public/android/WebThemeEngine.h>
     75#else
    7276#include "WebFontInfo.h"
    73 #include "WebFontRenderStyle.h"
    7477#include <public/linux/WebThemeEngine.h>
    75 #elif OS(ANDROID)
    76 #include <public/android/WebThemeEngine.h>
    77 #endif
     78#endif // OS(ANDROID)
     79#endif // elif OS(UNIX)
    7880
    7981#include "NativeImageSkia.h"
     
    258260void PlatformSupport::getRenderStyleForStrike(const char* font, int sizeAndStyle, FontRenderStyle* result)
    259261{
    260 #if !OS(ANDROID)
    261262    WebFontRenderStyle style;
    262263
    263     if (WebKit::Platform::current()->sandboxSupport())
     264#if OS(ANDROID)
     265    style.setDefaults();
     266#else
     267    if (!font || !*font)
     268        style.setDefaults(); // It's probably a webfont. Take the system defaults.
     269    else if (WebKit::Platform::current()->sandboxSupport())
    264270        WebKit::Platform::current()->sandboxSupport()->getRenderStyleForStrike(font, sizeAndStyle, &style);
    265271    else
    266272        WebFontInfo::renderStyleForStrike(font, sizeAndStyle, &style);
     273#endif
    267274
    268275    style.toFontRenderStyle(result);
    269 #endif
    270276}
    271277#endif
Note: See TracChangeset for help on using the changeset viewer.