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

Unified Diff: third_party/WebKit/Source/platform/fonts/CharacterProperty.h

Issue 1541393003: Improve performance of Character::isCJKIdeographOrSymbol by using trie tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tweak conditions Created 4 years, 11 months 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/CharacterProperty.h
diff --git a/third_party/WebKit/Source/platform/fonts/CharacterProperty.h b/third_party/WebKit/Source/platform/fonts/CharacterProperty.h
new file mode 100644
index 0000000000000000000000000000000000000000..7b37a983d2f105ee37ba15eb757cb89a4ca624bd
--- /dev/null
+++ b/third_party/WebKit/Source/platform/fonts/CharacterProperty.h
@@ -0,0 +1,39 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <cstdint>
+
+namespace blink {
+
+using CharacterPropertyType = uint8_t;
+
+enum class CharacterProperty : CharacterPropertyType {
+ isCJKIdeographOrSymbol = 0x0001,
+ isUprightInMixedVertical = 0x0002,
+};
+
+inline CharacterProperty operator | (
+ CharacterProperty a, CharacterProperty b)
+{
+ return static_cast<CharacterProperty>(
+ static_cast<CharacterPropertyType>(a)
+ | static_cast<CharacterPropertyType>(b));
+}
+
+inline CharacterProperty operator & (
+ CharacterProperty a, CharacterProperty b)
+{
+ return static_cast<CharacterProperty>(
+ static_cast<CharacterPropertyType>(a)
+ & static_cast<CharacterPropertyType>(b));
+}
+
+inline CharacterProperty operator |= (
+ CharacterProperty& a, CharacterProperty b)
+{
+ a = a | b;
+ return a;
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698