Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(619)

Unified Diff: third_party/WebKit/Source/platform/fonts/shaping/ShapeCache.h

Issue 2555923002: Changed TextDirection to an enum class and renamed its members (Closed)
Patch Set: Rebase after reopen Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/fonts/shaping/ShapeCache.h
diff --git a/third_party/WebKit/Source/platform/fonts/shaping/ShapeCache.h b/third_party/WebKit/Source/platform/fonts/shaping/ShapeCache.h
index a1a5c424c9ab909e88086922521be916e2a5440a..0b6b7d2f8be451a76cd46aa7326fe34bce936e00 100644
--- a/third_party/WebKit/Source/platform/fonts/shaping/ShapeCache.h
+++ b/third_party/WebKit/Source/platform/fonts/shaping/ShapeCache.h
@@ -57,16 +57,19 @@ class ShapeCache {
public:
static unsigned capacity() { return s_capacity; }
- SmallStringKey() : m_length(s_emptyValueLength), m_direction(LTR) {}
+ SmallStringKey()
+ : m_length(s_emptyValueLength),
+ m_direction(static_cast<unsigned>(TextDirection::Ltr)) {}
SmallStringKey(WTF::HashTableDeletedValueType)
- : m_length(s_deletedValueLength), m_direction(LTR) {}
+ : m_length(s_deletedValueLength),
+ m_direction(static_cast<unsigned>(TextDirection::Ltr)) {}
template <typename CharacterType>
SmallStringKey(CharacterType* characters,
unsigned short length,
TextDirection direction)
- : m_length(length), m_direction(direction) {
+ : m_length(length), m_direction(static_cast<unsigned>(direction)) {
ASSERT(length <= s_capacity);
StringHasher hasher;
@@ -185,7 +188,7 @@ class ShapeCache {
uint32_t key = run[0];
// All current codepointsin UTF-32 are bewteen 0x0 and 0x10FFFF,
// as such use bit 32 to indicate direction.
- if (run.direction() == RTL)
+ if (run.direction() == TextDirection::Rtl)
key |= (1u << 31);
SingleCharMap::AddResult addResult = m_singleCharMap.add(key, entry);
isNewEntry = addResult.isNewEntry;

Powered by Google App Engine
This is Rietveld 408576698