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

Side by Side Diff: Source/core/css/CSSFontFace.h

Issue 270813003: Reland r172943 "Make CSSFontFace::willUseFontData() load fonts with unicode-range" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 bool operator<(UChar32 c) const { return m_to < c; } 90 bool operator<(UChar32 c) const { return m_to < c; }
91 91
92 private: 92 private:
93 UChar32 m_from; 93 UChar32 m_from;
94 UChar32 m_to; 94 UChar32 m_to;
95 }; 95 };
96 96
97 class UnicodeRangeSet { 97 class UnicodeRangeSet {
98 public: 98 public:
99 explicit UnicodeRangeSet(const Vector<UnicodeRange>&); 99 explicit UnicodeRangeSet(const Vector<UnicodeRange>&);
100 bool contains(UChar32) const;
100 bool intersectsWith(const String&) const; 101 bool intersectsWith(const String&) const;
101 bool isEntireRange() const { return m_ranges.isEmpty(); } 102 bool isEntireRange() const { return m_ranges.isEmpty(); }
102 size_t size() const { return m_ranges.size(); } 103 size_t size() const { return m_ranges.size(); }
103 const UnicodeRange& rangeAt(size_t i) const { return m_ranges[i]; } 104 const UnicodeRange& rangeAt(size_t i) const { return m_ranges[i]; }
104 private: 105 private:
105 Vector<UnicodeRange> m_ranges; // If empty, represents the whole code sp ace. 106 Vector<UnicodeRange> m_ranges; // If empty, represents the whole code sp ace.
106 }; 107 };
107 108
108 FontFace::LoadStatus loadStatus() const { return m_fontFace->loadStatus(); } 109 FontFace::LoadStatus loadStatus() const { return m_fontFace->loadStatus(); }
109 void willUseFontData(const FontDescription&); 110 bool maybeScheduleFontLoad(const FontDescription&, UChar32);
110 void load(const FontDescription&, CSSFontSelector* = 0); 111 void load(const FontDescription&, CSSFontSelector* = 0);
111 112
112 bool hadBlankText() { return isValid() && m_sources.first()->hadBlankText(); } 113 bool hadBlankText() { return isValid() && m_sources.first()->hadBlankText(); }
113 114
114 void trace(Visitor*); 115 void trace(Visitor*);
115 116
116 private: 117 private:
117 void setLoadStatus(FontFace::LoadStatus); 118 void setLoadStatus(FontFace::LoadStatus);
118 119
119 UnicodeRangeSet m_ranges; 120 UnicodeRangeSet m_ranges;
120 RawPtrWillBeMember<CSSSegmentedFontFace> m_segmentedFontFace; 121 RawPtrWillBeMember<CSSSegmentedFontFace> m_segmentedFontFace;
121 Deque<OwnPtr<CSSFontFaceSource> > m_sources; 122 Deque<OwnPtr<CSSFontFaceSource> > m_sources;
122 RawPtrWillBeMember<FontFace> m_fontFace; 123 RawPtrWillBeMember<FontFace> m_fontFace;
123 }; 124 };
124 125
125 } 126 }
126 127
127 #endif 128 #endif
OLDNEW
« no previous file with comments | « LayoutTests/fast/css/font-face-unicode-range-overlap-load-expected.txt ('k') | Source/core/css/CSSFontFace.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698