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

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

Issue 317993002: Fix SK_API for DirectWrite port. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 6 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 | 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 2014 Google Inc. 2 * Copyright 2014 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 #include "SkDWrite.h" 8 #include "SkDWrite.h"
9 #include "SkDWriteFontFileStream.h" 9 #include "SkDWriteFontFileStream.h"
10 #include "SkFontMgr.h" 10 #include "SkFontMgr.h"
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 "Could not match font in family."); 721 "Could not match font in family.");
722 722
723 SkTScopedComPtr<IDWriteFontFace> fontFace; 723 SkTScopedComPtr<IDWriteFontFace> fontFace;
724 HRNM(font->CreateFontFace(&fontFace), "Could not create font face."); 724 HRNM(font->CreateFontFace(&fontFace), "Could not create font face.");
725 725
726 return fFontMgr->createTypefaceFromDWriteFont(fontFace.get(), font.get(), 726 return fFontMgr->createTypefaceFromDWriteFont(fontFace.get(), font.get(),
727 fFontFamily.get()); 727 fFontFamily.get());
728 } 728 }
729 729
730 //////////////////////////////////////////////////////////////////////////////// 730 ////////////////////////////////////////////////////////////////////////////////
731 #include "SkTypeface_win.h"
731 732
732 SkFontMgr* SkFontMgr_New_DirectWrite(IDWriteFactory* factory) { 733 SK_API SkFontMgr* SkFontMgr_New_DirectWrite(IDWriteFactory* factory) {
733 if (NULL == factory) { 734 if (NULL == factory) {
734 factory = sk_get_dwrite_factory(); 735 factory = sk_get_dwrite_factory();
735 if (NULL == factory) { 736 if (NULL == factory) {
736 return NULL; 737 return NULL;
737 } 738 }
738 } 739 }
739 740
740 SkTScopedComPtr<IDWriteFontCollection> sysFontCollection; 741 SkTScopedComPtr<IDWriteFontCollection> sysFontCollection;
741 HRNM(factory->GetSystemFontCollection(&sysFontCollection, FALSE), 742 HRNM(factory->GetSystemFontCollection(&sysFontCollection, FALSE),
742 "Could not get system font collection."); 743 "Could not get system font collection.");
(...skipping 11 matching lines...) Expand all
754 localeNameLen = getUserDefaultLocaleNameProc(localeNameStorage, LOCALE_N AME_MAX_LENGTH); 755 localeNameLen = getUserDefaultLocaleNameProc(localeNameStorage, LOCALE_N AME_MAX_LENGTH);
755 if (localeNameLen) { 756 if (localeNameLen) {
756 localeName = localeNameStorage; 757 localeName = localeNameStorage;
757 }; 758 };
758 } 759 }
759 760
760 return SkNEW_ARGS(SkFontMgr_DirectWrite, (factory, sysFontCollection.get(), 761 return SkNEW_ARGS(SkFontMgr_DirectWrite, (factory, sysFontCollection.get(),
761 localeName, localeNameLen)); 762 localeName, localeNameLen));
762 } 763 }
763 764
764 ////////////////////////////////////////////////////////////////////////////////
765
766 #include "SkFontMgr_indirect.h" 765 #include "SkFontMgr_indirect.h"
767 #include "SkTypeface_win.h" 766 SK_API SkFontMgr* SkFontMgr_New_DirectWriteRenderer(SkRemotableFontMgr* proxy) {
768 SkFontMgr* SkFontMgr_New_DirectWriteRenderer(SkRemotableFontMgr* proxy) {
769 SkAutoTUnref<SkFontMgr> impl(SkFontMgr_New_DirectWrite()); 767 SkAutoTUnref<SkFontMgr> impl(SkFontMgr_New_DirectWrite());
770 if (impl.get() == NULL) { 768 if (impl.get() == NULL) {
771 return NULL; 769 return NULL;
772 } 770 }
773 return SkNEW_ARGS(SkFontMgr_Indirect, (impl.get(), proxy)); 771 return SkNEW_ARGS(SkFontMgr_Indirect, (impl.get(), proxy));
774 } 772 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698