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

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

Issue 2544283003: Use upcoming CTFont hb_face constructor (Closed)
Patch Set: Use upcoming CTFont hb_face constructor Created 4 years 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) 2012 Google Inc. All rights reserved. 2 * Copyright (c) 2012 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 328
329 #if !OS(MACOSX) 329 #if !OS(MACOSX)
330 static void deleteTypefaceStream(void* streamAssetPtr) { 330 static void deleteTypefaceStream(void* streamAssetPtr) {
331 SkStreamAsset* streamAsset = reinterpret_cast<SkStreamAsset*>(streamAssetPtr); 331 SkStreamAsset* streamAsset = reinterpret_cast<SkStreamAsset*>(streamAssetPtr);
332 delete streamAsset; 332 delete streamAsset;
333 } 333 }
334 #endif 334 #endif
335 335
336 hb_face_t* HarfBuzzFace::createFace() { 336 hb_face_t* HarfBuzzFace::createFace() {
337 #if OS(MACOSX) 337 #if OS(MACOSX)
338 hb_face_t* face = hb_coretext_face_create(m_platformData->cgFont()); 338 hb_face_t* face = hb_coretext_face_create_from_ct_font(m_platformData->ctFont( ));
339 #else 339 #else
340 hb_face_t* face = nullptr; 340 hb_face_t* face = nullptr;
341 341
342 DEFINE_STATIC_LOCAL(BooleanHistogram, zeroCopySuccessHistogram, 342 DEFINE_STATIC_LOCAL(BooleanHistogram, zeroCopySuccessHistogram,
343 ("Blink.Fonts.HarfBuzzFaceZeroCopyAccess")); 343 ("Blink.Fonts.HarfBuzzFaceZeroCopyAccess"));
344 SkTypeface* typeface = m_platformData->typeface(); 344 SkTypeface* typeface = m_platformData->typeface();
345 CHECK(typeface); 345 CHECK(typeface);
346 int ttcIndex = 0; 346 int ttcIndex = 0;
347 SkStreamAsset* typefaceStream = typeface->openStream(&ttcIndex); 347 SkStreamAsset* typefaceStream = typeface->openStream(&ttcIndex);
348 if (typefaceStream && typefaceStream->getMemoryBase()) { 348 if (typefaceStream && typefaceStream->getMemoryBase()) {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 m_harfBuzzFontData->m_paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding); 386 m_harfBuzzFontData->m_paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
387 m_harfBuzzFontData->m_rangeSet = rangeSet; 387 m_harfBuzzFontData->m_rangeSet = rangeSet;
388 m_harfBuzzFontData->updateSimpleFontData(m_platformData); 388 m_harfBuzzFontData->updateSimpleFontData(m_platformData);
389 ASSERT(m_harfBuzzFontData->m_simpleFontData); 389 ASSERT(m_harfBuzzFontData->m_simpleFontData);
390 int scale = SkiaScalarToHarfBuzzPosition(m_platformData->size()); 390 int scale = SkiaScalarToHarfBuzzPosition(m_platformData->size());
391 hb_font_set_scale(m_unscaledFont, scale, scale); 391 hb_font_set_scale(m_unscaledFont, scale, scale);
392 return m_unscaledFont; 392 return m_unscaledFont;
393 } 393 }
394 394
395 } // namespace blink 395 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/fonts/FontPlatformData.cpp ('k') | third_party/harfbuzz-ng/src/hb-coretext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698