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

Side by Side Diff: third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzShaper.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 | « third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.cpp ('k') | no next file » | 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) 2012 Google Inc. All rights reserved. 2 * Copyright (c) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013 BlackBerry Limited. All rights reserved. 3 * Copyright (C) 2013 BlackBerry Limited. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 288
289 hb_buffer_set_language(harfBuzzBuffer, language); 289 hb_buffer_set_language(harfBuzzBuffer, language);
290 hb_buffer_set_script(harfBuzzBuffer, ICUScriptToHBScript(currentRunScript)); 290 hb_buffer_set_script(harfBuzzBuffer, ICUScriptToHBScript(currentRunScript));
291 hb_buffer_set_direction(harfBuzzBuffer, TextDirectionToHBDirection(m_textRun .direction(), 291 hb_buffer_set_direction(harfBuzzBuffer, TextDirectionToHBDirection(m_textRun .direction(),
292 m_font->getFontDescription().orientation(), currentFont)); 292 m_font->getFontDescription().orientation(), currentFont));
293 293
294 addToHarfBuzzBufferInternal(harfBuzzBuffer, 294 addToHarfBuzzBufferInternal(harfBuzzBuffer,
295 m_font->getFontDescription(), m_normalizedBuffer.get(), m_normalizedBuff erLength, 295 m_font->getFontDescription(), m_normalizedBuffer.get(), m_normalizedBuff erLength,
296 startIndex, numCharacters); 296 startIndex, numCharacters);
297 297
298 hb_font_t* hbFont = face->getScaledFont(currentFontRangeSet); 298 HarfBuzzScopedPtr<hb_font_t> harfBuzzFont(face->createFont(currentFontRangeS et), hb_font_destroy);
299 hb_shape(hbFont, harfBuzzBuffer, m_features.isEmpty() ? 0 : m_features.data( ), m_features.size()); 299 hb_shape(harfBuzzFont.get(), harfBuzzBuffer, m_features.isEmpty() ? 0 : m_fe atures.data(), m_features.size());
300 300
301 return true; 301 return true;
302 } 302 }
303 303
304 bool HarfBuzzShaper::extractShapeResults(hb_buffer_t* harfBuzzBuffer, 304 bool HarfBuzzShaper::extractShapeResults(hb_buffer_t* harfBuzzBuffer,
305 ShapeResult* shapeResult, 305 ShapeResult* shapeResult,
306 bool& fontCycleQueued, const HolesQueueItem& currentQueueItem, 306 bool& fontCycleQueued, const HolesQueueItem& currentQueueItem,
307 const SimpleFontData* currentFont, 307 const SimpleFontData* currentFont,
308 UScriptCode currentRunScript, 308 UScriptCode currentRunScript,
309 bool isLastResort) 309 bool isLastResort)
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 result->m_width = run->m_width; 679 result->m_width = run->m_width;
680 result->m_numGlyphs = count; 680 result->m_numGlyphs = count;
681 ASSERT(result->m_numGlyphs == count); // no overflow 681 ASSERT(result->m_numGlyphs == count); // no overflow
682 result->m_hasVerticalOffsets = fontData->platformData().isVerticalAnyUpright (); 682 result->m_hasVerticalOffsets = fontData->platformData().isVerticalAnyUpright ();
683 result->m_runs.append(run.release()); 683 result->m_runs.append(run.release());
684 return result.release(); 684 return result.release();
685 } 685 }
686 686
687 687
688 } // namespace blink 688 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698