| OLD | NEW |
| 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 "SkDataTable.h" | 10 #include "SkDataTable.h" |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 } | 459 } |
| 460 const DataId& id = fDataIdCache[dataId]; | 460 const DataId& id = fDataIdCache[dataId]; |
| 461 | 461 |
| 462 SkTScopedComPtr<IDWriteFontFileLoader> loader; | 462 SkTScopedComPtr<IDWriteFontFileLoader> loader; |
| 463 HRNM(id.fLoader->QueryInterface(&loader), "QuerryInterface IDWriteFontFi
leLoader failed"); | 463 HRNM(id.fLoader->QueryInterface(&loader), "QuerryInterface IDWriteFontFi
leLoader failed"); |
| 464 | 464 |
| 465 SkTScopedComPtr<IDWriteFontFileStream> fontFileStream; | 465 SkTScopedComPtr<IDWriteFontFileStream> fontFileStream; |
| 466 HRNM(loader->CreateStreamFromKey(id.fKey, id.fKeySize, &fontFileStream), | 466 HRNM(loader->CreateStreamFromKey(id.fKey, id.fKeySize, &fontFileStream), |
| 467 "Could not create font file stream."); | 467 "Could not create font file stream."); |
| 468 | 468 |
| 469 return SkNEW_ARGS(SkDWriteFontFileStream, (fontFileStream.get())); | 469 return new SkDWriteFontFileStream(fontFileStream.get()); |
| 470 } | 470 } |
| 471 | 471 |
| 472 private: | 472 private: |
| 473 SkTScopedComPtr<IDWriteFontCollection> fFontCollection; | 473 SkTScopedComPtr<IDWriteFontCollection> fFontCollection; |
| 474 SkSMallocWCHAR fLocaleName; | 474 SkSMallocWCHAR fLocaleName; |
| 475 | 475 |
| 476 typedef SkRemotableFontMgr INHERITED; | 476 typedef SkRemotableFontMgr INHERITED; |
| 477 }; | 477 }; |
| 478 | 478 |
| 479 SkRemotableFontMgr* SkRemotableFontMgr_New_DirectWrite() { | 479 SkRemotableFontMgr* SkRemotableFontMgr_New_DirectWrite() { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 495 HRESULT hr = SkGetGetUserDefaultLocaleNameProc(&getUserDefaultLocaleNameProc
); | 495 HRESULT hr = SkGetGetUserDefaultLocaleNameProc(&getUserDefaultLocaleNameProc
); |
| 496 if (NULL == getUserDefaultLocaleNameProc) { | 496 if (NULL == getUserDefaultLocaleNameProc) { |
| 497 SK_TRACEHR(hr, "Could not get GetUserDefaultLocaleName."); | 497 SK_TRACEHR(hr, "Could not get GetUserDefaultLocaleName."); |
| 498 } else { | 498 } else { |
| 499 localeNameLen = getUserDefaultLocaleNameProc(localeNameStorage, LOCALE_N
AME_MAX_LENGTH); | 499 localeNameLen = getUserDefaultLocaleNameProc(localeNameStorage, LOCALE_N
AME_MAX_LENGTH); |
| 500 if (localeNameLen) { | 500 if (localeNameLen) { |
| 501 localeName = localeNameStorage; | 501 localeName = localeNameStorage; |
| 502 }; | 502 }; |
| 503 } | 503 } |
| 504 | 504 |
| 505 return SkNEW_ARGS(SkRemotableFontMgr_DirectWrite, (sysFontCollection.get(), | 505 return new SkRemotableFontMgr_DirectWrite(sysFontCollection.get(), localeNam
e, localeNameLen); |
| 506 localeName, localeNameLen
)); | |
| 507 } | 506 } |
| OLD | NEW |