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

Side by Side Diff: src/ports/SkFontConfigInterface_direct.cpp

Issue 2339273002: SkFontData to use smart pointers. (Closed)
Patch Set: Add trivial bodies to the trivial implementations. Created 4 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 | « src/images/SkMovie.cpp ('k') | src/ports/SkFontConfigTypeface.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 2009-2015 Google Inc. 2 * Copyright 2009-2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 /* migrated from chrome/src/skia/ext/SkFontHost_fontconfig_direct.cpp */ 8 /* migrated from chrome/src/skia/ext/SkFontHost_fontconfig_direct.cpp */
9 9
10 #include "SkBuffer.h" 10 #include "SkBuffer.h"
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 if (outFamilyName) { 695 if (outFamilyName) {
696 outFamilyName->set(post_config_family); 696 outFamilyName->set(post_config_family);
697 } 697 }
698 if (outStyle) { 698 if (outStyle) {
699 *outStyle = skfontstyle_from_fcpattern(match); 699 *outStyle = skfontstyle_from_fcpattern(match);
700 } 700 }
701 return true; 701 return true;
702 } 702 }
703 703
704 SkStreamAsset* SkFontConfigInterfaceDirect::openStream(const FontIdentity& ident ity) { 704 SkStreamAsset* SkFontConfigInterfaceDirect::openStream(const FontIdentity& ident ity) {
705 return SkStream::NewFromFile(identity.fString.c_str()); 705 return SkStream::MakeFromFile(identity.fString.c_str()).release();
706 } 706 }
707 707
708 /////////////////////////////////////////////////////////////////////////////// 708 ///////////////////////////////////////////////////////////////////////////////
709 709
710 static bool find_name(const SkTDArray<const char*>& list, const char* str) { 710 static bool find_name(const SkTDArray<const char*>& list, const char* str) {
711 int count = list.count(); 711 int count = list.count();
712 for (int i = 0; i < count; ++i) { 712 for (int i = 0; i < count; ++i) {
713 if (!strcmp(list[i], str)) { 713 if (!strcmp(list[i], str)) {
714 return true; 714 return true;
715 } 715 }
(...skipping 29 matching lines...) Expand all
745 const char* famName = get_name(match, FC_FAMILY); 745 const char* famName = get_name(match, FC_FAMILY);
746 if (famName && !find_name(names, famName)) { 746 if (famName && !find_name(names, famName)) {
747 *names.append() = famName; 747 *names.append() = famName;
748 *sizes.append() = strlen(famName) + 1; 748 *sizes.append() = strlen(famName) + 1;
749 } 749 }
750 } 750 }
751 751
752 return SkDataTable::MakeCopyArrays((const void*const*)names.begin(), 752 return SkDataTable::MakeCopyArrays((const void*const*)names.begin(),
753 sizes.begin(), names.count()); 753 sizes.begin(), names.count());
754 } 754 }
OLDNEW
« no previous file with comments | « src/images/SkMovie.cpp ('k') | src/ports/SkFontConfigTypeface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698