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)
return normalizeSpacesInternal(characters, length);
}
}
} // namespace blink
......@@ -74,6 +74,6 @@ private:
Character();
};
}
} // namespace blink
#endif
......@@ -60,6 +60,6 @@ protected:
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)
}
} // namespace blink
#endif // CustomFontData_h
......@@ -12,6 +12,6 @@ enum FixedPitchFontType {
NonFixedPitchFont
};
}
} // namespace blink
#endif // FixedPitchFontType_h
......@@ -839,4 +839,4 @@ int Font::offsetForPositionForSimpleText(const TextRun& run, float x, bool inclu
return offset;
}
}
} // namespace blink
......@@ -222,6 +222,6 @@ inline float Font::tabWidth(const SimpleFontData& fontData, unsigned tabSize, fl
return tabWidth - fmodf(position, tabWidth);
}
}
} // namespace blink
#endif
......@@ -114,7 +114,7 @@ FontPlatformData* FontCache::getFontPlatformData(const FontDescription& fontDesc
}
#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()
{
......
......@@ -180,6 +180,6 @@ public:
~FontCachePurgePreventer() { FontCache::fontCache()->enablePurging(); }
};
}
} // namespace blink
#endif
......@@ -111,6 +111,6 @@ struct FontCacheKeyHash {
struct FontCacheKeyTraits : WTF::SimpleClassHashTraits<FontCacheKey> { };
}
} // namespace blink
#endif // FontCacheKey_h
......@@ -12,7 +12,7 @@
namespace blink {
class EmptyPlatform : public blink::Platform {
class EmptyPlatform : public Platform {
public:
EmptyPlatform() { }
virtual ~EmptyPlatform() { }
......@@ -24,9 +24,9 @@ TEST(FontCache, getLastResortFallbackFont)
FontCache* fontCache = FontCache::fontCache();
ASSERT_TRUE(fontCache);
blink::Platform* oldPlatform = blink::Platform::current();
Platform* oldPlatform = Platform::current();
OwnPtr<EmptyPlatform> platform = adoptPtr(new EmptyPlatform);
blink::Platform::initialize(platform.get());
Platform::initialize(platform.get());
if (emptyAtom.isNull())
AtomicString::init();
......@@ -40,7 +40,7 @@ TEST(FontCache, getLastResortFallbackFont)
fontData = fontCache->getLastResortFallbackFont(fontDescription, Retain);
EXPECT_TRUE(fontData);
blink::Platform::initialize(oldPlatform);
Platform::initialize(oldPlatform);
}
} // namespace blink
......@@ -152,4 +152,4 @@ bool FontDataCache::purgeLeastRecentlyUsed(int count)
return didWork;
}
}
} // namespace blink
......@@ -94,6 +94,6 @@ private:
ListHashSet<RefPtr<SimpleFontData> > m_inactiveFontData;
};
}
} // namespace blink
#endif
......@@ -267,6 +267,6 @@ inline bool FontDescription::operator==(const FontDescription& other) const
&& m_subpixelTextPosition == other.m_subpixelTextPosition;
}
}
} // namespace blink
#endif
......@@ -243,4 +243,4 @@ const FontData* FontFallbackList::fontDataAt(const FontDescription& fontDescript
return result.get();
}
}
} // namespace blink
......@@ -131,6 +131,6 @@ private:
mutable bool m_hasLoadingFallback : 1;
};
}
} // namespace blink
#endif
......@@ -43,4 +43,4 @@ bool operator==(const FontFamily& a, const FontFamily& b)
return true;
}
}
} // namespace blink
......@@ -90,6 +90,6 @@ inline PassRefPtr<SharedFontFamily> FontFamily::releaseNext()
return m_next.release();
}
}
} // namespace blink
#endif
......@@ -43,4 +43,4 @@ FontFeatureSettings::FontFeatureSettings()
{
}
}
} // namespace blink
......@@ -64,6 +64,6 @@ private:
Vector<FontFeature> m_list;
};
}
} // namespace blink
#endif // FontFeatureSettings_h
......@@ -119,4 +119,4 @@ const FontPlatformData& FontPlatformData::operator=(const FontPlatformData& othe
return platformDataAssign(other);
}
}
} // namespace blink
......@@ -44,6 +44,6 @@ private:
FontPlatformFeatures();
};
}
} // namespace blink
#endif
......@@ -72,6 +72,6 @@ struct FontRenderStyle {
char useSubpixelPositioning; // use subpixel positioning (fractional X positions for glyphs)
};
}
} // namespace blink
#endif // FontRenderStyle_h
......@@ -183,4 +183,4 @@ void GenericFontFamilySettings::reset()
m_pictographFontFamilyMap.clear();
}
}
} // namespace blink
......@@ -100,6 +100,6 @@ private:
ScriptFontFamilyMap m_pictographFontFamilyMap;
};
}
} // namespace blink
#endif
......@@ -111,5 +111,6 @@ private:
bool m_hasVerticalAdvances;
};
}
} // namespace blink
#endif
......@@ -402,7 +402,7 @@ void GlyphPageTreeNode::pruneFontData(const SimpleFontData* fontData, unsigned l
}
#endif
}
} // namespace blink
#ifndef NDEBUG
void showGlyphPageTrees()
......
......@@ -62,6 +62,6 @@ private:
int m_lastCharacter;
};
}
} // namespace blink
#endif
......@@ -186,6 +186,6 @@ bool isCompatibleGlyph(const SVGGlyph& identifier, bool isVerticalText, const St
return isCompatibleArabicForm(identifier, chars, startPosition, endPosition);
}
}
} // namespace blink
#endif
......@@ -264,4 +264,4 @@ bool WidthIterator::advanceOneCharacter(float& width)
return true;
}
}
} // namespace blink
......@@ -98,6 +98,6 @@ private:
bool m_forTextEmphasis : 1;
};
}
} // namespace blink
#endif
......@@ -70,6 +70,6 @@ private:
hb_script_t m_scriptForVerticalText;
};
}
} // namespace blink
#endif // HarfBuzzFace_h
......@@ -36,11 +36,11 @@ namespace blink {
void FontCache::getFontForCharacter(UChar32 c, const char* preferredLocale, FontCache::PlatformFallbackFont* fallbackFont)
{
blink::WebFallbackFont webFallbackFont;
if (blink::Platform::current()->sandboxSupport())
blink::Platform::current()->sandboxSupport()->getFallbackFontForCharacter(c, preferredLocale, &webFallbackFont);
WebFallbackFont webFallbackFont;
if (Platform::current()->sandboxSupport())
Platform::current()->sandboxSupport()->getFallbackFontForCharacter(c, preferredLocale, &webFallbackFont);
else
blink::WebFontInfo::fallbackFontForChar(c, preferredLocale, &webFallbackFont);
WebFontInfo::fallbackFontForChar(c, preferredLocale, &webFallbackFont);
fallbackFont->name = String::fromUTF8(CString(webFallbackFont.name));
fallbackFont->filename = webFallbackFont.filename;
fallbackFont->fontconfigInterfaceId = webFallbackFont.fontconfigInterfaceId;
......@@ -49,4 +49,4 @@ void FontCache::getFontForCharacter(UChar32 c, const char* preferredLocale, Font
fallbackFont->isItalic = webFallbackFont.isItalic;
}
}
} // namespace blink
......@@ -102,16 +102,16 @@ void FontPlatformData::setupPaint(SkPaint* paint, GraphicsContext* context)
void FontPlatformData::querySystemForRenderStyle(bool useSkiaSubpixelPositioning)
{
blink::WebFontRenderStyle style;
WebFontRenderStyle style;
#if OS(ANDROID)
style.setDefaults();
#else
// 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();
} else {
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
style.toFontRenderStyle(&m_style);
......
......@@ -80,4 +80,4 @@ bool FontCustomPlatformData::supportsFormat(const String& format)
return equalIgnoringCase(format, "truetype") || equalIgnoringCase(format, "opentype") || OpenTypeSanitizer::supportsFormat(format);
}
}
} // namespace blink
......@@ -221,4 +221,4 @@ HANDLE renameAndActivateFont(SharedBuffer* fontData, const String& fontName)
return fontHandle;
}
}
} // namespace blink
......@@ -171,7 +171,7 @@ PassRefPtr<SkTypeface> FontCache::createTypeface(const FontDescription& fontDesc
// TODO(dro): crbug.com/381620 Use creationParams.ttcIndex() after
// https://code.google.com/p/skia/issues/detail?id=1186 gets fixed.
SkTypeface* typeface = nullptr;
if (blink::Platform::current()->sandboxSupport())
if (Platform::current()->sandboxSupport())
typeface = SkTypeface::CreateFromStream(streamForFontconfigInterfaceId(creationParams.fontconfigInterfaceId()));
else
typeface = SkTypeface::CreateFromFile(creationParams.filename().data());
......
......@@ -114,4 +114,4 @@ bool FontCustomPlatformData::supportsFormat(const String& format)
return equalIgnoringCase(format, "truetype") || equalIgnoringCase(format, "opentype") || OpenTypeSanitizer::supportsFormat(format);
}
}
} // namespace blink
......@@ -251,4 +251,4 @@ FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontD
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