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

Side by Side Diff: Source/platform/fonts/mac/FontComplexTextMac.cpp

Issue 567543002: Avoid re-parsing of string in fillText and measureText in Canvas (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updating test expectation file Created 6 years, 3 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
« no previous file with comments | « Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp ('k') | Source/platform/text/TextRun.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 ComplexTextController controller(this, run); 151 ComplexTextController controller(this, run);
152 return controller.offsetForPosition(x, includePartialGlyphs); 152 return controller.offsetForPosition(x, includePartialGlyphs);
153 } 153 }
154 154
155 const SimpleFontData* Font::fontDataForCombiningCharacterSequence(const UChar* c haracters, size_t length, FontDataVariant variant) const 155 const SimpleFontData* Font::fontDataForCombiningCharacterSequence(const UChar* c haracters, size_t length, FontDataVariant variant) const
156 { 156 {
157 UChar32 baseCharacter; 157 UChar32 baseCharacter;
158 size_t baseCharacterLength = 0; 158 size_t baseCharacterLength = 0;
159 U16_NEXT(characters, baseCharacterLength, length, baseCharacter); 159 U16_NEXT(characters, baseCharacterLength, length, baseCharacter);
160 160
161 GlyphData baseCharacterGlyphData = glyphDataForCharacter(baseCharacter, fals e, variant); 161 GlyphData baseCharacterGlyphData = glyphDataForCharacter(baseCharacter, fals e, false, variant);
162 162
163 if (!baseCharacterGlyphData.glyph) 163 if (!baseCharacterGlyphData.glyph)
164 return 0; 164 return 0;
165 165
166 if (length == baseCharacterLength) 166 if (length == baseCharacterLength)
167 return baseCharacterGlyphData.fontData; 167 return baseCharacterGlyphData.fontData;
168 168
169 bool triedBaseCharacterFontData = false; 169 bool triedBaseCharacterFontData = false;
170 170
171 unsigned i = 0; 171 unsigned i = 0;
(...skipping 28 matching lines...) Expand all
200 return simpleFontData; 200 return simpleFontData;
201 } 201 }
202 202
203 if (!triedBaseCharacterFontData && baseCharacterGlyphData.fontData && baseCh aracterGlyphData.fontData->canRenderCombiningCharacterSequence(characters, lengt h)) 203 if (!triedBaseCharacterFontData && baseCharacterGlyphData.fontData && baseCh aracterGlyphData.fontData->canRenderCombiningCharacterSequence(characters, lengt h))
204 return baseCharacterGlyphData.fontData; 204 return baseCharacterGlyphData.fontData;
205 205
206 return SimpleFontData::systemFallback(); 206 return SimpleFontData::systemFallback();
207 } 207 }
208 208
209 } // namespace blink 209 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp ('k') | Source/platform/text/TextRun.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698