Changeset 147863 in webkit


Ignore:
Timestamp:
Apr 6, 2013 6:31:33 PM (11 years ago)
Author:
benjamin@webkit.org
Message:

Remove the chromium code from platform/graphics/mac
https://bugs.webkit.org/show_bug.cgi?id=114107

Reviewed by Anders Carlsson.

  • platform/graphics/mac/FontCacheMac.mm:

(WebCore::FontCache::getFontDataForCharacters):
(WebCore::FontCache::createFontPlatformData):

  • platform/graphics/mac/FontComplexTextMac.cpp:

(WebCore::Font::selectionRectForComplexText):
(WebCore::Font::drawComplexText):
(WebCore::Font::floatWidthForComplexText):
(WebCore::Font::offsetForPositionForComplexText):

  • platform/graphics/mac/FontMac.mm:

(WebCore::hasBrokenCTFontGetVerticalTranslationsForGlyphs):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r147862 r147863  
     12013-04-06  Benjamin Poulain  <benjamin@webkit.org>
     2
     3        Remove the chromium code from platform/graphics/mac
     4        https://bugs.webkit.org/show_bug.cgi?id=114107
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * platform/graphics/mac/FontCacheMac.mm:
     9        (WebCore::FontCache::getFontDataForCharacters):
     10        (WebCore::FontCache::createFontPlatformData):
     11        * platform/graphics/mac/FontComplexTextMac.cpp:
     12        (WebCore::Font::selectionRectForComplexText):
     13        (WebCore::Font::drawComplexText):
     14        (WebCore::Font::floatWidthForComplexText):
     15        (WebCore::Font::offsetForPositionForComplexText):
     16        * platform/graphics/mac/FontMac.mm:
     17        (WebCore::hasBrokenCTFontGetVerticalTranslationsForGlyphs):
     18
    1192013-04-06  Benjamin Poulain  <benjamin@webkit.org>
    220
  • trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm

    r147710 r147863  
    103103        return 0;
    104104
    105 #if PLATFORM(CHROMIUM)
    106     // Chromium can't render AppleColorEmoji.
    107     if ([[substituteFont familyName] isEqual:@"Apple Color Emoji"])
    108         return 0;
    109 #endif
    110 
    111105    // Use the family name from the AppKit-supplied substitute font, requesting the
    112106    // traits, weight, and size we want. One way this does better than the original
     
    224218    bool syntheticOblique = (traits & NSFontItalicTrait) && !(actualTraits & NSFontItalicTrait);
    225219
    226     // FontPlatformData::font() can be null for the case of Chromium out-of-process font loading.
    227     // In that case, we don't want to use the platformData.
    228220    OwnPtr<FontPlatformData> platformData = adoptPtr(new FontPlatformData(platformFont, size, fontDescription.usePrinterFont(), syntheticBold, syntheticOblique, fontDescription.orientation(), fontDescription.widthVariant()));
    229     if (!platformData->font())
    230         return nullptr;
    231221    return platformData.release();
    232222}
  • trunk/Source/WebCore/platform/graphics/mac/FontComplexTextMac.cpp

    r136640 r147863  
    3535#include <wtf/MathExtras.h>
    3636
    37 #if PLATFORM(CHROMIUM)
    38 #include "HarfBuzzShaper.h"
    39 #endif
    40 
    4137using namespace std;
    4238
    4339namespace WebCore {
    4440
    45 #if PLATFORM(CHROMIUM)
    46 static bool preferHarfBuzz(const Font* font)
    47 {
    48     const FontDescription& description = font->fontDescription();
    49     return description.featureSettings() && description.featureSettings()->size() > 0;
    50 }
    51 #endif
    52 
    5341FloatRect Font::selectionRectForComplexText(const TextRun& run, const FloatPoint& point, int h,
    5442                                            int from, int to) const
    5543{
    56 #if PLATFORM(CHROMIUM)
    57     if (preferHarfBuzz(this)) {
    58         HarfBuzzShaper shaper(this, run);
    59         if (shaper.shape())
    60             return shaper.selectionRect(point, h, from, to);
    61     }
    62 #endif
    6344    ComplexTextController controller(this, run);
    6445    controller.advance(from);
     
    10182void Font::drawComplexText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, int from, int to) const
    10283{
    103 #if PLATFORM(CHROMIUM)
    104     if (preferHarfBuzz(this)) {
    105         GlyphBuffer glyphBuffer;
    106         HarfBuzzShaper shaper(this, run);
    107         shaper.setDrawRange(from, to);
    108         if (shaper.shape(&glyphBuffer)) {
    109             drawGlyphBuffer(context, run, glyphBuffer, point);
    110             return;
    111         }
    112     }
    113 #endif
    11484    // This glyph buffer holds our glyphs + advances + font data for each glyph.
    11585    GlyphBuffer glyphBuffer;
     
    139109float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const
    140110{
    141 #if PLATFORM(CHROMIUM)
    142     if (preferHarfBuzz(this)) {
    143         HarfBuzzShaper shaper(this, run);
    144         if (shaper.shape())
    145             return shaper.totalWidth();
    146     }
    147 #endif
    148111    ComplexTextController controller(this, run, true, fallbackFonts);
    149112    if (glyphOverflow) {
     
    158121int Font::offsetForPositionForComplexText(const TextRun& run, float x, bool includePartialGlyphs) const
    159122{
    160 #if PLATFORM(CHROMIUM)
    161     if (preferHarfBuzz(this)) {
    162         HarfBuzzShaper shaper(this, run);
    163         if (shaper.shape())
    164             return shaper.offsetForPosition(x);
    165     }
    166 #endif
    167123    ComplexTextController controller(this, run);
    168124    return controller.offsetForPosition(x, includePartialGlyphs);
  • trunk/Source/WebCore/platform/graphics/mac/FontMac.mm

    r145854 r147863  
    5858static bool hasBrokenCTFontGetVerticalTranslationsForGlyphs()
    5959{
    60 // Chromium runs the same binary on both Leopard and Snow Leopard, so the check has to happen at runtime.
    61 #if PLATFORM(CHROMIUM)
    62     static bool isCached = false;
    63     static bool result;
    64    
    65     if (!isCached) {
    66         SInt32 majorVersion = 0;
    67         SInt32 minorVersion = 0;
    68         Gestalt(gestaltSystemVersionMajor, &majorVersion);
    69         Gestalt(gestaltSystemVersionMinor, &minorVersion);
    70         result = majorVersion == 10 && minorVersion == 6;
    71         isCached = true;
    72     }
    73     return result;
    74 #elif !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED == 1060
     60#if !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED == 1060
    7561    return true;
    7662#else
Note: See TracChangeset for help on using the changeset viewer.