Modified: trunk/Source/WebCore/ChangeLog (147862 => 147863)
--- trunk/Source/WebCore/ChangeLog 2013-04-07 01:30:21 UTC (rev 147862)
+++ trunk/Source/WebCore/ChangeLog 2013-04-07 01:31:33 UTC (rev 147863)
@@ -1,5 +1,23 @@
2013-04-06 Benjamin Poulain <benja...@webkit.org>
+ 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):
+
+2013-04-06 Benjamin Poulain <benja...@webkit.org>
+
Clean platform/graphics/cg of the chromium bits
https://bugs.webkit.org/show_bug.cgi?id=114106
Modified: trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm (147862 => 147863)
--- trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm 2013-04-07 01:30:21 UTC (rev 147862)
+++ trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm 2013-04-07 01:31:33 UTC (rev 147863)
@@ -102,12 +102,6 @@
if (!substituteFont)
return 0;
-#if PLATFORM(CHROMIUM)
- // Chromium can't render AppleColorEmoji.
- if ([[substituteFont familyName] isEqual:@"Apple Color Emoji"])
- return 0;
-#endif
-
// Use the family name from the AppKit-supplied substitute font, requesting the
// traits, weight, and size we want. One way this does better than the original
// AppKit request is that it takes synthetic bold and oblique into account.
@@ -223,11 +217,7 @@
bool syntheticBold = isAppKitFontWeightBold(weight) && !isAppKitFontWeightBold(actualWeight);
bool syntheticOblique = (traits & NSFontItalicTrait) && !(actualTraits & NSFontItalicTrait);
- // FontPlatformData::font() can be null for the case of Chromium out-of-process font loading.
- // In that case, we don't want to use the platformData.
OwnPtr<FontPlatformData> platformData = adoptPtr(new FontPlatformData(platformFont, size, fontDescription.usePrinterFont(), syntheticBold, syntheticOblique, fontDescription.orientation(), fontDescription.widthVariant()));
- if (!platformData->font())
- return nullptr;
return platformData.release();
}
Modified: trunk/Source/WebCore/platform/graphics/mac/FontComplexTextMac.cpp (147862 => 147863)
--- trunk/Source/WebCore/platform/graphics/mac/FontComplexTextMac.cpp 2013-04-07 01:30:21 UTC (rev 147862)
+++ trunk/Source/WebCore/platform/graphics/mac/FontComplexTextMac.cpp 2013-04-07 01:31:33 UTC (rev 147863)
@@ -34,32 +34,13 @@
#include "TextRun.h"
#include <wtf/MathExtras.h>
-#if PLATFORM(CHROMIUM)
-#include "HarfBuzzShaper.h"
-#endif
-
using namespace std;
namespace WebCore {
-#if PLATFORM(CHROMIUM)
-static bool preferHarfBuzz(const Font* font)
-{
- const FontDescription& description = font->fontDescription();
- return description.featureSettings() && description.featureSettings()->size() > 0;
-}
-#endif
-
FloatRect Font::selectionRectForComplexText(const TextRun& run, const FloatPoint& point, int h,
int from, int to) const
{
-#if PLATFORM(CHROMIUM)
- if (preferHarfBuzz(this)) {
- HarfBuzzShaper shaper(this, run);
- if (shaper.shape())
- return shaper.selectionRect(point, h, from, to);
- }
-#endif
ComplexTextController controller(this, run);
controller.advance(from);
float beforeWidth = controller.runWidthSoFar();
@@ -100,17 +81,6 @@
void Font::drawComplexText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, int from, int to) const
{
-#if PLATFORM(CHROMIUM)
- if (preferHarfBuzz(this)) {
- GlyphBuffer glyphBuffer;
- HarfBuzzShaper shaper(this, run);
- shaper.setDrawRange(from, to);
- if (shaper.shape(&glyphBuffer)) {
- drawGlyphBuffer(context, run, glyphBuffer, point);
- return;
- }
- }
-#endif
// This glyph buffer holds our glyphs + advances + font data for each glyph.
GlyphBuffer glyphBuffer;
@@ -138,13 +108,6 @@
float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const
{
-#if PLATFORM(CHROMIUM)
- if (preferHarfBuzz(this)) {
- HarfBuzzShaper shaper(this, run);
- if (shaper.shape())
- return shaper.totalWidth();
- }
-#endif
ComplexTextController controller(this, run, true, fallbackFonts);
if (glyphOverflow) {
glyphOverflow->top = max<int>(glyphOverflow->top, ceilf(-controller.minGlyphBoundingBoxY()) - (glyphOverflow->computeBounds ? 0 : fontMetrics().ascent()));
@@ -157,13 +120,6 @@
int Font::offsetForPositionForComplexText(const TextRun& run, float x, bool includePartialGlyphs) const
{
-#if PLATFORM(CHROMIUM)
- if (preferHarfBuzz(this)) {
- HarfBuzzShaper shaper(this, run);
- if (shaper.shape())
- return shaper.offsetForPosition(x);
- }
-#endif
ComplexTextController controller(this, run);
return controller.offsetForPosition(x, includePartialGlyphs);
}
Modified: trunk/Source/WebCore/platform/graphics/mac/FontMac.mm (147862 => 147863)
--- trunk/Source/WebCore/platform/graphics/mac/FontMac.mm 2013-04-07 01:30:21 UTC (rev 147862)
+++ trunk/Source/WebCore/platform/graphics/mac/FontMac.mm 2013-04-07 01:31:33 UTC (rev 147863)
@@ -57,21 +57,7 @@
// divides by unitsPerEm.
static bool hasBrokenCTFontGetVerticalTranslationsForGlyphs()
{
-// Chromium runs the same binary on both Leopard and Snow Leopard, so the check has to happen at runtime.
-#if PLATFORM(CHROMIUM)
- static bool isCached = false;
- static bool result;
-
- if (!isCached) {
- SInt32 majorVersion = 0;
- SInt32 minorVersion = 0;
- Gestalt(gestaltSystemVersionMajor, &majorVersion);
- Gestalt(gestaltSystemVersionMinor, &minorVersion);
- result = majorVersion == 10 && minorVersion == 6;
- isCached = true;
- }
- return result;
-#elif !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED == 1060
+#if !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED == 1060
return true;
#else
return false;