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

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

Issue 248473005: Make CSSFontFace::willUseFontData() load fonts with unicode-range (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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 willUseFontData(const FontDescription&, const String& text);
dglazkov 2014/04/29 16:37:00 Might need to rename this into something that make
Kunihiko Sakamoto 2014/04/30 03:31:21 Renamed to maybeScheduleFontLoad.
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 private: 115 private:
115 void setLoadStatus(FontFace::LoadStatus); 116 void setLoadStatus(FontFace::LoadStatus);
116 117
117 UnicodeRangeSet m_ranges; 118 UnicodeRangeSet m_ranges;
118 // FIXME: Oilpan: Make m_segmentedFontFace a RawPtrWillBeMember when moving 119 // FIXME: Oilpan: Make m_segmentedFontFace a RawPtrWillBeMember when moving
119 // CSSFontFace to the heap. 120 // CSSFontFace to the heap.
120 CSSSegmentedFontFace* m_segmentedFontFace; 121 CSSSegmentedFontFace* m_segmentedFontFace;
121 Deque<OwnPtr<CSSFontFaceSource> > m_sources; 122 Deque<OwnPtr<CSSFontFaceSource> > m_sources;
122 FontFace* m_fontFace; 123 FontFace* m_fontFace;
123 }; 124 };
124 125
125 } 126 }
126 127
127 #endif 128 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698