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

Side by Side Diff: third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzShaper.h

Issue 2507063010: Moving string normalization out of HarfBuzz (Closed)
Patch Set: Merge w/HEAD 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 // 124 //
125 // Now this sub run is successfully processed and can be appended to 125 // Now this sub run is successfully processed and can be appended to
126 // ShapeResult. A new ShapeResult::RunInfo is created. The logic in 126 // ShapeResult. A new ShapeResult::RunInfo is created. The logic in
127 // insertRunIntoShapeResult then takes care of merging the shape result into 127 // insertRunIntoShapeResult then takes care of merging the shape result into
128 // the right position the vector of RunInfos in ShapeResult. 128 // the right position the vector of RunInfos in ShapeResult.
129 // 129 //
130 // Shaping then continues analogously for the remaining Hiragana Japanese 130 // Shaping then continues analogously for the remaining Hiragana Japanese
131 // sub-run, and the result is inserted into ShapeResult as well. 131 // sub-run, and the result is inserted into ShapeResult as well.
132 class PLATFORM_EXPORT HarfBuzzShaper final { 132 class PLATFORM_EXPORT HarfBuzzShaper final {
133 public: 133 public:
134 HarfBuzzShaper(const TextRun&); 134 HarfBuzzShaper(const UChar*, unsigned length, TextDirection);
135 PassRefPtr<ShapeResult> shapeResult(const Font*) const; 135 PassRefPtr<ShapeResult> shapeResult(const Font*) const;
136 ~HarfBuzzShaper() {} 136 ~HarfBuzzShaper() {}
137 137
138 enum HolesQueueItemAction { HolesQueueNextFont, HolesQueueRange }; 138 enum HolesQueueItemAction { HolesQueueNextFont, HolesQueueRange };
139 139
140 struct HolesQueueItem { 140 struct HolesQueueItem {
141 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); 141 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
142 HolesQueueItemAction m_action; 142 HolesQueueItemAction m_action;
143 unsigned m_startIndex; 143 unsigned m_startIndex;
144 unsigned m_numCharacters; 144 unsigned m_numCharacters;
(...skipping 14 matching lines...) Expand all
159 bool collectFallbackHintChars(const Deque<HolesQueueItem>&, 159 bool collectFallbackHintChars(const Deque<HolesQueueItem>&,
160 Vector<UChar32>& hint) const; 160 Vector<UChar32>& hint) const;
161 161
162 void insertRunIntoShapeResult( 162 void insertRunIntoShapeResult(
163 ShapeResult*, 163 ShapeResult*,
164 std::unique_ptr<ShapeResult::RunInfo> runToInsert, 164 std::unique_ptr<ShapeResult::RunInfo> runToInsert,
165 unsigned startGlyph, 165 unsigned startGlyph,
166 unsigned numGlyphs, 166 unsigned numGlyphs,
167 hb_buffer_t*); 167 hb_buffer_t*);
168 168
169 const TextRun& m_textRun; 169 const UChar* m_normalizedBuffer;
170 std::unique_ptr<UChar[]> m_normalizedBuffer;
171 unsigned m_normalizedBufferLength; 170 unsigned m_normalizedBufferLength;
171 TextDirection m_textDirection;
172 }; 172 };
173 173
174 } // namespace blink 174 } // namespace blink
175 175
176 #endif // HarfBuzzShaper_h 176 #endif // HarfBuzzShaper_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698