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

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

Issue 1880623002: Revert "Reland: Move glyph lookup to hb-ot-font and remove glyph cache in HarfBuzzFace" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.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) 2011 Brent Fulgham 2 * Copyright (C) 2011 Brent Fulgham
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 0); 279 0);
280 if (hb_set_has(glyphs, space)) 280 if (hb_set_has(glyphs, space))
281 return true; 281 return true;
282 } 282 }
283 return false; 283 return false;
284 } 284 }
285 285
286 bool FontPlatformData::hasSpaceInLigaturesOrKerning( 286 bool FontPlatformData::hasSpaceInLigaturesOrKerning(
287 TypesettingFeatures features) const 287 TypesettingFeatures features) const
288 { 288 {
289 HarfBuzzFace* hbFace = harfBuzzFace(); 289 const HarfBuzzFace* hbFace = harfBuzzFace();
290 if (!hbFace) 290 if (!hbFace)
291 return false; 291 return false;
292 292
293 hb_face_t* face = hbFace->face(); 293 hb_face_t* face = hbFace->face();
294 ASSERT(face); 294 ASSERT(face);
295 hb_font_t* font = hbFace->getScaledFont(); 295 OwnPtr<hb_font_t> font = adoptPtr(hbFace->createFont());
296 ASSERT(font); 296 ASSERT(font);
297 297
298 hb_codepoint_t space; 298 hb_codepoint_t space;
299 // If the space glyph isn't present in the font then each space character 299 // If the space glyph isn't present in the font then each space character
300 // will be rendering using a fallback font, which grantees that it cannot 300 // will be rendering using a fallback font, which grantees that it cannot
301 // affect the shape of the preceding word. 301 // affect the shape of the preceding word.
302 if (!hb_font_get_glyph(font, spaceCharacter, 0, &space)) 302 if (!hb_font_get_glyph(font.get(), spaceCharacter, 0, &space))
303 return false; 303 return false;
304 304
305 if (!hb_ot_layout_has_substitution(face) 305 if (!hb_ot_layout_has_substitution(face)
306 && !hb_ot_layout_has_positioning(face)) { 306 && !hb_ot_layout_has_positioning(face)) {
307 return false; 307 return false;
308 } 308 }
309 309
310 bool foundSpaceInTable = false; 310 bool foundSpaceInTable = false;
311 hb_set_t* glyphs = hb_set_create(); 311 hb_set_t* glyphs = hb_set_create();
312 if (features & Kerning) 312 if (features & Kerning)
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 const size_t tableSize = m_typeface->getTableSize(tag); 361 const size_t tableSize = m_typeface->getTableSize(tag);
362 if (tableSize) { 362 if (tableSize) {
363 Vector<char> tableBuffer(tableSize); 363 Vector<char> tableBuffer(tableSize);
364 m_typeface->getTableData(tag, 0, tableSize, &tableBuffer[0]); 364 m_typeface->getTableData(tag, 0, tableSize, &tableBuffer[0]);
365 buffer = SharedBuffer::adoptVector(tableBuffer); 365 buffer = SharedBuffer::adoptVector(tableBuffer);
366 } 366 }
367 return buffer.release(); 367 return buffer.release();
368 } 368 }
369 369
370 } // namespace blink 370 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698