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

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

Issue 1943993003: Cache hb_font_t and the user data container instead of hb_face_t (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reset paint flags properly Created 4 years, 7 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/opentype/OpenTypeCapsSupportMPL.cpp » ('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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 return false; 260 return false;
261 } 261 }
262 262
263 bool FontPlatformData::hasSpaceInLigaturesOrKerning( 263 bool FontPlatformData::hasSpaceInLigaturesOrKerning(
264 TypesettingFeatures features) const 264 TypesettingFeatures features) const
265 { 265 {
266 HarfBuzzFace* hbFace = harfBuzzFace(); 266 HarfBuzzFace* hbFace = harfBuzzFace();
267 if (!hbFace) 267 if (!hbFace)
268 return false; 268 return false;
269 269
270 hb_face_t* face = hbFace->face();
271 ASSERT(face);
272 hb_font_t* font = hbFace->getScaledFont(); 270 hb_font_t* font = hbFace->getScaledFont();
273 ASSERT(font); 271 ASSERT(font);
272 hb_face_t* face = hb_font_get_face(font);
273 ASSERT(face);
274 274
275 hb_codepoint_t space; 275 hb_codepoint_t space;
276 // If the space glyph isn't present in the font then each space character 276 // If the space glyph isn't present in the font then each space character
277 // will be rendering using a fallback font, which grantees that it cannot 277 // will be rendering using a fallback font, which grantees that it cannot
278 // affect the shape of the preceding word. 278 // affect the shape of the preceding word.
279 if (!hb_font_get_glyph(font, spaceCharacter, 0, &space)) 279 if (!hb_font_get_glyph(font, spaceCharacter, 0, &space))
280 return false; 280 return false;
281 281
282 if (!hb_ot_layout_has_substitution(face) 282 if (!hb_ot_layout_has_substitution(face)
283 && !hb_ot_layout_has_positioning(face)) { 283 && !hb_ot_layout_has_positioning(face)) {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 const size_t tableSize = m_typeface->getTableSize(tag); 337 const size_t tableSize = m_typeface->getTableSize(tag);
338 if (tableSize) { 338 if (tableSize) {
339 Vector<char> tableBuffer(tableSize); 339 Vector<char> tableBuffer(tableSize);
340 m_typeface->getTableData(tag, 0, tableSize, &tableBuffer[0]); 340 m_typeface->getTableData(tag, 0, tableSize, &tableBuffer[0]);
341 buffer = SharedBuffer::adoptVector(tableBuffer); 341 buffer = SharedBuffer::adoptVector(tableBuffer);
342 } 342 }
343 return buffer.release(); 343 return buffer.release();
344 } 344 }
345 345
346 } // namespace blink 346 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/fonts/opentype/OpenTypeCapsSupportMPL.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698