Changeset 147863 in webkit
- Timestamp:
- Apr 6, 2013 6:31:33 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r147862 r147863 1 2013-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 1 19 2013-04-06 Benjamin Poulain <benjamin@webkit.org> 2 20 -
trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm
r147710 r147863 103 103 return 0; 104 104 105 #if PLATFORM(CHROMIUM)106 // Chromium can't render AppleColorEmoji.107 if ([[substituteFont familyName] isEqual:@"Apple Color Emoji"])108 return 0;109 #endif110 111 105 // Use the family name from the AppKit-supplied substitute font, requesting the 112 106 // traits, weight, and size we want. One way this does better than the original … … 224 218 bool syntheticOblique = (traits & NSFontItalicTrait) && !(actualTraits & NSFontItalicTrait); 225 219 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.228 220 OwnPtr<FontPlatformData> platformData = adoptPtr(new FontPlatformData(platformFont, size, fontDescription.usePrinterFont(), syntheticBold, syntheticOblique, fontDescription.orientation(), fontDescription.widthVariant())); 229 if (!platformData->font())230 return nullptr;231 221 return platformData.release(); 232 222 } -
trunk/Source/WebCore/platform/graphics/mac/FontComplexTextMac.cpp
r136640 r147863 35 35 #include <wtf/MathExtras.h> 36 36 37 #if PLATFORM(CHROMIUM)38 #include "HarfBuzzShaper.h"39 #endif40 41 37 using namespace std; 42 38 43 39 namespace WebCore { 44 40 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 #endif52 53 41 FloatRect Font::selectionRectForComplexText(const TextRun& run, const FloatPoint& point, int h, 54 42 int from, int to) const 55 43 { 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 #endif63 44 ComplexTextController controller(this, run); 64 45 controller.advance(from); … … 101 82 void Font::drawComplexText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, int from, int to) const 102 83 { 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 #endif114 84 // This glyph buffer holds our glyphs + advances + font data for each glyph. 115 85 GlyphBuffer glyphBuffer; … … 139 109 float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const 140 110 { 141 #if PLATFORM(CHROMIUM)142 if (preferHarfBuzz(this)) {143 HarfBuzzShaper shaper(this, run);144 if (shaper.shape())145 return shaper.totalWidth();146 }147 #endif148 111 ComplexTextController controller(this, run, true, fallbackFonts); 149 112 if (glyphOverflow) { … … 158 121 int Font::offsetForPositionForComplexText(const TextRun& run, float x, bool includePartialGlyphs) const 159 122 { 160 #if PLATFORM(CHROMIUM)161 if (preferHarfBuzz(this)) {162 HarfBuzzShaper shaper(this, run);163 if (shaper.shape())164 return shaper.offsetForPosition(x);165 }166 #endif167 123 ComplexTextController controller(this, run); 168 124 return controller.offsetForPosition(x, includePartialGlyphs); -
trunk/Source/WebCore/platform/graphics/mac/FontMac.mm
r145854 r147863 58 58 static bool hasBrokenCTFontGetVerticalTranslationsForGlyphs() 59 59 { 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 75 61 return true; 76 62 #else
Note: See TracChangeset
for help on using the changeset viewer.