Cleanup namespace usage in platform/fonts/.

Review URL: https://codereview.chromium.org/468443002

git-svn-id: svn://svn.chromium.org/blink/trunk@180224 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent d1cd1418
...@@ -372,4 +372,4 @@ String Character::normalizeSpaces(const UChar* characters, unsigned length) ...@@ -372,4 +372,4 @@ String Character::normalizeSpaces(const UChar* characters, unsigned length)
return normalizeSpacesInternal(characters, length); return normalizeSpacesInternal(characters, length);
} }
} } // namespace blink
...@@ -74,6 +74,6 @@ private: ...@@ -74,6 +74,6 @@ private:
Character(); Character();
}; };
} } // namespace blink
#endif #endif
...@@ -60,6 +60,6 @@ protected: ...@@ -60,6 +60,6 @@ protected:
template<typename T> inline thisType* to##thisType(const RefPtr<T>& customFontData) { return to##thisType(customFontData.get()); } \ template<typename T> inline thisType* to##thisType(const RefPtr<T>& customFontData) { return to##thisType(customFontData.get()); } \
DEFINE_TYPE_CASTS(thisType, CustomFontData, customFontData, customFontData->predicate, customFontData.predicate) DEFINE_TYPE_CASTS(thisType, CustomFontData, customFontData, customFontData->predicate, customFontData.predicate)
} } // namespace blink
#endif // CustomFontData_h #endif // CustomFontData_h
...@@ -12,6 +12,6 @@ enum FixedPitchFontType { ...@@ -12,6 +12,6 @@ enum FixedPitchFontType {
NonFixedPitchFont NonFixedPitchFont
}; };
} } // namespace blink
#endif // FixedPitchFontType_h #endif // FixedPitchFontType_h
...@@ -839,4 +839,4 @@ int Font::offsetForPositionForSimpleText(const TextRun& run, float x, bool inclu ...@@ -839,4 +839,4 @@ int Font::offsetForPositionForSimpleText(const TextRun& run, float x, bool inclu
return offset; return offset;
} }
} } // namespace blink
...@@ -222,6 +222,6 @@ inline float Font::tabWidth(const SimpleFontData& fontData, unsigned tabSize, fl ...@@ -222,6 +222,6 @@ inline float Font::tabWidth(const SimpleFontData& fontData, unsigned tabSize, fl
return tabWidth - fmodf(position, tabWidth); return tabWidth - fmodf(position, tabWidth);
} }
} } // namespace blink
#endif #endif
...@@ -114,7 +114,7 @@ FontPlatformData* FontCache::getFontPlatformData(const FontDescription& fontDesc ...@@ -114,7 +114,7 @@ FontPlatformData* FontCache::getFontPlatformData(const FontDescription& fontDesc
} }
#if ENABLE(OPENTYPE_VERTICAL) #if ENABLE(OPENTYPE_VERTICAL)
typedef HashMap<FontCache::FontFileKey, RefPtr<OpenTypeVerticalData>, WTF::IntHash<FontCache::FontFileKey>, WTF::UnsignedWithZeroKeyHashTraits<FontCache::FontFileKey> > FontVerticalDataCache; typedef HashMap<FontCache::FontFileKey, RefPtr<OpenTypeVerticalData>, IntHash<FontCache::FontFileKey>, UnsignedWithZeroKeyHashTraits<FontCache::FontFileKey> > FontVerticalDataCache;
FontVerticalDataCache& fontVerticalDataCacheInstance() FontVerticalDataCache& fontVerticalDataCacheInstance()
{ {
......
...@@ -180,6 +180,6 @@ public: ...@@ -180,6 +180,6 @@ public:
~FontCachePurgePreventer() { FontCache::fontCache()->enablePurging(); } ~FontCachePurgePreventer() { FontCache::fontCache()->enablePurging(); }
}; };
} } // namespace blink
#endif #endif
...@@ -111,6 +111,6 @@ struct FontCacheKeyHash { ...@@ -111,6 +111,6 @@ struct FontCacheKeyHash {
struct FontCacheKeyTraits : WTF::SimpleClassHashTraits<FontCacheKey> { }; struct FontCacheKeyTraits : WTF::SimpleClassHashTraits<FontCacheKey> { };
} } // namespace blink
#endif // FontCacheKey_h #endif // FontCacheKey_h
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
namespace blink { namespace blink {
class EmptyPlatform : public blink::Platform { class EmptyPlatform : public Platform {
public: public:
EmptyPlatform() { } EmptyPlatform() { }
virtual ~EmptyPlatform() { } virtual ~EmptyPlatform() { }
...@@ -24,9 +24,9 @@ TEST(FontCache, getLastResortFallbackFont) ...@@ -24,9 +24,9 @@ TEST(FontCache, getLastResortFallbackFont)
FontCache* fontCache = FontCache::fontCache(); FontCache* fontCache = FontCache::fontCache();
ASSERT_TRUE(fontCache); ASSERT_TRUE(fontCache);
blink::Platform* oldPlatform = blink::Platform::current(); Platform* oldPlatform = Platform::current();
OwnPtr<EmptyPlatform> platform = adoptPtr(new EmptyPlatform); OwnPtr<EmptyPlatform> platform = adoptPtr(new EmptyPlatform);
blink::Platform::initialize(platform.get()); Platform::initialize(platform.get());
if (emptyAtom.isNull()) if (emptyAtom.isNull())
AtomicString::init(); AtomicString::init();
...@@ -40,7 +40,7 @@ TEST(FontCache, getLastResortFallbackFont) ...@@ -40,7 +40,7 @@ TEST(FontCache, getLastResortFallbackFont)
fontData = fontCache->getLastResortFallbackFont(fontDescription, Retain); fontData = fontCache->getLastResortFallbackFont(fontDescription, Retain);
EXPECT_TRUE(fontData); EXPECT_TRUE(fontData);
blink::Platform::initialize(oldPlatform); Platform::initialize(oldPlatform);
} }
} // namespace blink } // namespace blink
...@@ -152,4 +152,4 @@ bool FontDataCache::purgeLeastRecentlyUsed(int count) ...@@ -152,4 +152,4 @@ bool FontDataCache::purgeLeastRecentlyUsed(int count)
return didWork; return didWork;
} }
} } // namespace blink
...@@ -94,6 +94,6 @@ private: ...@@ -94,6 +94,6 @@ private:
ListHashSet<RefPtr<SimpleFontData> > m_inactiveFontData; ListHashSet<RefPtr<SimpleFontData> > m_inactiveFontData;
}; };
} } // namespace blink
#endif #endif
...@@ -267,6 +267,6 @@ inline bool FontDescription::operator==(const FontDescription& other) const ...@@ -267,6 +267,6 @@ inline bool FontDescription::operator==(const FontDescription& other) const
&& m_subpixelTextPosition == other.m_subpixelTextPosition; && m_subpixelTextPosition == other.m_subpixelTextPosition;
} }
} } // namespace blink
#endif #endif
...@@ -243,4 +243,4 @@ const FontData* FontFallbackList::fontDataAt(const FontDescription& fontDescript ...@@ -243,4 +243,4 @@ const FontData* FontFallbackList::fontDataAt(const FontDescription& fontDescript
return result.get(); return result.get();
} }
} } // namespace blink
...@@ -131,6 +131,6 @@ private: ...@@ -131,6 +131,6 @@ private:
mutable bool m_hasLoadingFallback : 1; mutable bool m_hasLoadingFallback : 1;
}; };
} } // namespace blink
#endif #endif
...@@ -43,4 +43,4 @@ bool operator==(const FontFamily& a, const FontFamily& b) ...@@ -43,4 +43,4 @@ bool operator==(const FontFamily& a, const FontFamily& b)
return true; return true;
} }
} } // namespace blink
...@@ -90,6 +90,6 @@ inline PassRefPtr<SharedFontFamily> FontFamily::releaseNext() ...@@ -90,6 +90,6 @@ inline PassRefPtr<SharedFontFamily> FontFamily::releaseNext()
return m_next.release(); return m_next.release();
} }
} } // namespace blink
#endif #endif
...@@ -43,4 +43,4 @@ FontFeatureSettings::FontFeatureSettings() ...@@ -43,4 +43,4 @@ FontFeatureSettings::FontFeatureSettings()
{ {
} }
} } // namespace blink
...@@ -64,6 +64,6 @@ private: ...@@ -64,6 +64,6 @@ private:
Vector<FontFeature> m_list; Vector<FontFeature> m_list;
}; };
} } // namespace blink
#endif // FontFeatureSettings_h #endif // FontFeatureSettings_h
...@@ -119,4 +119,4 @@ const FontPlatformData& FontPlatformData::operator=(const FontPlatformData& othe ...@@ -119,4 +119,4 @@ const FontPlatformData& FontPlatformData::operator=(const FontPlatformData& othe
return platformDataAssign(other); return platformDataAssign(other);
} }
} } // namespace blink
...@@ -44,6 +44,6 @@ private: ...@@ -44,6 +44,6 @@ private:
FontPlatformFeatures(); FontPlatformFeatures();
}; };
} } // namespace blink
#endif #endif
...@@ -72,6 +72,6 @@ struct FontRenderStyle { ...@@ -72,6 +72,6 @@ struct FontRenderStyle {
char useSubpixelPositioning; // use subpixel positioning (fractional X positions for glyphs) char useSubpixelPositioning; // use subpixel positioning (fractional X positions for glyphs)
}; };
} } // namespace blink
#endif // FontRenderStyle_h #endif // FontRenderStyle_h
...@@ -183,4 +183,4 @@ void GenericFontFamilySettings::reset() ...@@ -183,4 +183,4 @@ void GenericFontFamilySettings::reset()
m_pictographFontFamilyMap.clear(); m_pictographFontFamilyMap.clear();
} }
} } // namespace blink
...@@ -100,6 +100,6 @@ private: ...@@ -100,6 +100,6 @@ private:
ScriptFontFamilyMap m_pictographFontFamilyMap; ScriptFontFamilyMap m_pictographFontFamilyMap;
}; };
} } // namespace blink
#endif #endif
...@@ -111,5 +111,6 @@ private: ...@@ -111,5 +111,6 @@ private:
bool m_hasVerticalAdvances; bool m_hasVerticalAdvances;
}; };
} } // namespace blink
#endif #endif
...@@ -402,7 +402,7 @@ void GlyphPageTreeNode::pruneFontData(const SimpleFontData* fontData, unsigned l ...@@ -402,7 +402,7 @@ void GlyphPageTreeNode::pruneFontData(const SimpleFontData* fontData, unsigned l
} }
#endif #endif
} } // namespace blink
#ifndef NDEBUG #ifndef NDEBUG
void showGlyphPageTrees() void showGlyphPageTrees()
......
...@@ -62,6 +62,6 @@ private: ...@@ -62,6 +62,6 @@ private:
int m_lastCharacter; int m_lastCharacter;
}; };
} } // namespace blink
#endif #endif
...@@ -186,6 +186,6 @@ bool isCompatibleGlyph(const SVGGlyph& identifier, bool isVerticalText, const St ...@@ -186,6 +186,6 @@ bool isCompatibleGlyph(const SVGGlyph& identifier, bool isVerticalText, const St
return isCompatibleArabicForm(identifier, chars, startPosition, endPosition); return isCompatibleArabicForm(identifier, chars, startPosition, endPosition);
} }
} } // namespace blink
#endif #endif
...@@ -264,4 +264,4 @@ bool WidthIterator::advanceOneCharacter(float& width) ...@@ -264,4 +264,4 @@ bool WidthIterator::advanceOneCharacter(float& width)
return true; return true;
} }
} } // namespace blink
...@@ -98,6 +98,6 @@ private: ...@@ -98,6 +98,6 @@ private:
bool m_forTextEmphasis : 1; bool m_forTextEmphasis : 1;
}; };
} } // namespace blink
#endif #endif
...@@ -70,6 +70,6 @@ private: ...@@ -70,6 +70,6 @@ private:
hb_script_t m_scriptForVerticalText; hb_script_t m_scriptForVerticalText;
}; };
} } // namespace blink
#endif // HarfBuzzFace_h #endif // HarfBuzzFace_h
...@@ -36,11 +36,11 @@ namespace blink { ...@@ -36,11 +36,11 @@ namespace blink {
void FontCache::getFontForCharacter(UChar32 c, const char* preferredLocale, FontCache::PlatformFallbackFont* fallbackFont) void FontCache::getFontForCharacter(UChar32 c, const char* preferredLocale, FontCache::PlatformFallbackFont* fallbackFont)
{ {
blink::WebFallbackFont webFallbackFont; WebFallbackFont webFallbackFont;
if (blink::Platform::current()->sandboxSupport()) if (Platform::current()->sandboxSupport())
blink::Platform::current()->sandboxSupport()->getFallbackFontForCharacter(c, preferredLocale, &webFallbackFont); Platform::current()->sandboxSupport()->getFallbackFontForCharacter(c, preferredLocale, &webFallbackFont);
else else
blink::WebFontInfo::fallbackFontForChar(c, preferredLocale, &webFallbackFont); WebFontInfo::fallbackFontForChar(c, preferredLocale, &webFallbackFont);
fallbackFont->name = String::fromUTF8(CString(webFallbackFont.name)); fallbackFont->name = String::fromUTF8(CString(webFallbackFont.name));
fallbackFont->filename = webFallbackFont.filename; fallbackFont->filename = webFallbackFont.filename;
fallbackFont->fontconfigInterfaceId = webFallbackFont.fontconfigInterfaceId; fallbackFont->fontconfigInterfaceId = webFallbackFont.fontconfigInterfaceId;
...@@ -49,4 +49,4 @@ void FontCache::getFontForCharacter(UChar32 c, const char* preferredLocale, Font ...@@ -49,4 +49,4 @@ void FontCache::getFontForCharacter(UChar32 c, const char* preferredLocale, Font
fallbackFont->isItalic = webFallbackFont.isItalic; fallbackFont->isItalic = webFallbackFont.isItalic;
} }
} } // namespace blink
...@@ -102,16 +102,16 @@ void FontPlatformData::setupPaint(SkPaint* paint, GraphicsContext* context) ...@@ -102,16 +102,16 @@ void FontPlatformData::setupPaint(SkPaint* paint, GraphicsContext* context)
void FontPlatformData::querySystemForRenderStyle(bool useSkiaSubpixelPositioning) void FontPlatformData::querySystemForRenderStyle(bool useSkiaSubpixelPositioning)
{ {
blink::WebFontRenderStyle style; WebFontRenderStyle style;
#if OS(ANDROID) #if OS(ANDROID)
style.setDefaults(); style.setDefaults();
#else #else
// If the font name is missing (i.e. probably a web font) or the sandbox is disabled, use the system defaults. // If the font name is missing (i.e. probably a web font) or the sandbox is disabled, use the system defaults.
if (!m_family.length() || !blink::Platform::current()->sandboxSupport()) { if (!m_family.length() || !Platform::current()->sandboxSupport()) {
style.setDefaults(); style.setDefaults();
} else { } else {
const int sizeAndStyle = (((int)m_textSize) << 2) | (m_typeface->style() & 3); const int sizeAndStyle = (((int)m_textSize) << 2) | (m_typeface->style() & 3);
blink::Platform::current()->sandboxSupport()->getRenderStyleForStrike(m_family.data(), sizeAndStyle, &style); Platform::current()->sandboxSupport()->getRenderStyleForStrike(m_family.data(), sizeAndStyle, &style);
} }
#endif #endif
style.toFontRenderStyle(&m_style); style.toFontRenderStyle(&m_style);
......
...@@ -80,4 +80,4 @@ bool FontCustomPlatformData::supportsFormat(const String& format) ...@@ -80,4 +80,4 @@ bool FontCustomPlatformData::supportsFormat(const String& format)
return equalIgnoringCase(format, "truetype") || equalIgnoringCase(format, "opentype") || OpenTypeSanitizer::supportsFormat(format); return equalIgnoringCase(format, "truetype") || equalIgnoringCase(format, "opentype") || OpenTypeSanitizer::supportsFormat(format);
} }
} } // namespace blink
...@@ -221,4 +221,4 @@ HANDLE renameAndActivateFont(SharedBuffer* fontData, const String& fontName) ...@@ -221,4 +221,4 @@ HANDLE renameAndActivateFont(SharedBuffer* fontData, const String& fontName)
return fontHandle; return fontHandle;
} }
} } // namespace blink
...@@ -171,7 +171,7 @@ PassRefPtr<SkTypeface> FontCache::createTypeface(const FontDescription& fontDesc ...@@ -171,7 +171,7 @@ PassRefPtr<SkTypeface> FontCache::createTypeface(const FontDescription& fontDesc
// TODO(dro): crbug.com/381620 Use creationParams.ttcIndex() after // TODO(dro): crbug.com/381620 Use creationParams.ttcIndex() after
// https://code.google.com/p/skia/issues/detail?id=1186 gets fixed. // https://code.google.com/p/skia/issues/detail?id=1186 gets fixed.
SkTypeface* typeface = nullptr; SkTypeface* typeface = nullptr;
if (blink::Platform::current()->sandboxSupport()) if (Platform::current()->sandboxSupport())
typeface = SkTypeface::CreateFromStream(streamForFontconfigInterfaceId(creationParams.fontconfigInterfaceId())); typeface = SkTypeface::CreateFromStream(streamForFontconfigInterfaceId(creationParams.fontconfigInterfaceId()));
else else
typeface = SkTypeface::CreateFromFile(creationParams.filename().data()); typeface = SkTypeface::CreateFromFile(creationParams.filename().data());
......
...@@ -114,4 +114,4 @@ bool FontCustomPlatformData::supportsFormat(const String& format) ...@@ -114,4 +114,4 @@ bool FontCustomPlatformData::supportsFormat(const String& format)
return equalIgnoringCase(format, "truetype") || equalIgnoringCase(format, "opentype") || OpenTypeSanitizer::supportsFormat(format); return equalIgnoringCase(format, "truetype") || equalIgnoringCase(format, "opentype") || OpenTypeSanitizer::supportsFormat(format);
} }
} } // namespace blink
...@@ -251,4 +251,4 @@ FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontD ...@@ -251,4 +251,4 @@ FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontD
return result; return result;
} }
} } // namespace blink
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment