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

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

Issue 1806653002: Shape unicode-range: font faces in only one iteration (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update UnicodeRangeSetTests to RefPtrtr, rm copy constructor and test Created 4 years, 9 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/UnicodeRangeSet.h
diff --git a/third_party/WebKit/Source/platform/fonts/UnicodeRangeSet.h b/third_party/WebKit/Source/platform/fonts/UnicodeRangeSet.h
index 465358fb72b9868f9c9db7f447f687a43a37af3a..e39e655c862579f370b5159079565be5334177e7 100644
--- a/third_party/WebKit/Source/platform/fonts/UnicodeRangeSet.h
+++ b/third_party/WebKit/Source/platform/fonts/UnicodeRangeSet.h
@@ -27,13 +27,16 @@
#define UnicodeRangeSet_h
#include "platform/PlatformExport.h"
-#include "platform/fonts/FontDataRange.h"
#include "wtf/Allocator.h"
+#include "wtf/RefCounted.h"
+#include "wtf/Vector.h"
+#include "wtf/text/CharacterNames.h"
#include "wtf/text/Unicode.h"
+#include "wtf/text/WTFString.h"
namespace blink {
-struct PLATFORM_EXPORT UnicodeRange {
+struct PLATFORM_EXPORT UnicodeRange final {
DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
UnicodeRange(UChar32 from, UChar32 to)
: m_from(from)
@@ -49,10 +52,9 @@ struct PLATFORM_EXPORT UnicodeRange {
return m_from < other.m_from;
}
bool operator<(UChar32 c) const { return m_to < c; }
- bool operator==(const FontDataRange& fontDataRange) const
+ bool operator==(const UnicodeRange& other) const
{
- return fontDataRange.from() == m_from
- && fontDataRange.to() == m_to;
+ return other.m_from == m_from && other.m_to == m_to;
};
private:
@@ -60,17 +62,17 @@ private:
UChar32 m_to;
};
-class PLATFORM_EXPORT UnicodeRangeSet {
- DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
-
+class PLATFORM_EXPORT UnicodeRangeSet : public RefCounted<UnicodeRangeSet> {
public:
explicit UnicodeRangeSet(const Vector<UnicodeRange>&);
+ UnicodeRangeSet() { };
bool contains(UChar32) const;
- bool contains(const FontDataRange&) const;
bool intersectsWith(const String&) const;
bool isEntireRange() const { return m_ranges.isEmpty(); }
size_t size() const { return m_ranges.size(); }
const UnicodeRange& rangeAt(size_t i) const { return m_ranges[i]; }
+ bool operator==(const UnicodeRangeSet& other) const;
+
private:
Vector<UnicodeRange> m_ranges; // If empty, represents the whole code space.
};

Powered by Google App Engine
This is Rietveld 408576698