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

Side by Side Diff: third_party/WebKit/Source/platform/fonts/FontFallbackList.cpp

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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2006 Apple Computer, 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 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 const SimpleFontData* fontDataForSpace = fontData->fontDataForCharacter( spaceCharacter); 126 const SimpleFontData* fontDataForSpace = fontData->fontDataForCharacter( spaceCharacter);
127 ASSERT(fontDataForSpace); 127 ASSERT(fontDataForSpace);
128 128
129 // When a custom font is loading, we should use the correct fallback fon t to layout the text. 129 // When a custom font is loading, we should use the correct fallback fon t to layout the text.
130 // Here skip the temporary font for the loading custom font which may no t act as the correct fallback font. 130 // Here skip the temporary font for the loading custom font which may no t act as the correct fallback font.
131 if (!fontDataForSpace->isLoadingFallback()) 131 if (!fontDataForSpace->isLoadingFallback())
132 return fontDataForSpace; 132 return fontDataForSpace;
133 133
134 if (fontData->isSegmented()) { 134 if (fontData->isSegmented()) {
135 const SegmentedFontData* segmented = toSegmentedFontData(fontData); 135 const SegmentedFontData* segmented = toSegmentedFontData(fontData);
136 for (unsigned i = 0; i < segmented->numRanges(); i++) { 136 for (unsigned i = 0; i < segmented->numFaces(); i++) {
137 const SimpleFontData* rangeFontData = segmented->rangeAt(i).font Data().get(); 137 const SimpleFontData* rangeFontData = segmented->faceAt(i).fontD ata().get();
138 if (!rangeFontData->isLoadingFallback()) 138 if (!rangeFontData->isLoadingFallback())
139 return rangeFontData; 139 return rangeFontData;
140 } 140 }
141 if (fontData->isLoading()) 141 if (fontData->isLoading())
142 shouldLoadCustomFont = false; 142 shouldLoadCustomFont = false;
143 } 143 }
144 144
145 // Begin to load the first custom font if needed. 145 // Begin to load the first custom font if needed.
146 if (shouldLoadCustomFont) { 146 if (shouldLoadCustomFont) {
147 shouldLoadCustomFont = false; 147 shouldLoadCustomFont = false;
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 231
232 bool FontFallbackList::isValid() const 232 bool FontFallbackList::isValid() const
233 { 233 {
234 if (!m_fontSelector) 234 if (!m_fontSelector)
235 return m_fontSelectorVersion == 0; 235 return m_fontSelectorVersion == 0;
236 236
237 return m_fontSelector->version() == m_fontSelectorVersion; 237 return m_fontSelector->version() == m_fontSelectorVersion;
238 } 238 }
239 239
240 } // namespace blink 240 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698