| 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 #include "SkTypes.h" | 7 #include "SkTypes.h" |
| 8 #if defined(SK_BUILD_FOR_WIN32) | 8 #if defined(SK_BUILD_FOR_WIN32) |
| 9 | 9 |
| 10 #include "SkDWrite.h" | 10 #include "SkDWrite.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 class SK_API SkRemotableFontMgr_DirectWrite : public SkRemotableFontMgr { | 26 class SK_API SkRemotableFontMgr_DirectWrite : public SkRemotableFontMgr { |
| 27 private: | 27 private: |
| 28 struct DataId { | 28 struct DataId { |
| 29 IUnknown* fLoader; // In COM only IUnknown pointers may be safely used
for identity. | 29 IUnknown* fLoader; // In COM only IUnknown pointers may be safely used
for identity. |
| 30 void* fKey; | 30 void* fKey; |
| 31 UINT32 fKeySize; | 31 UINT32 fKeySize; |
| 32 | 32 |
| 33 DataId() { } | 33 DataId() { } |
| 34 | 34 |
| 35 // This is actually a move!!! | 35 DataId(DataId&& that) : fLoader(that.fLoader), fKey(that.fKey), fKeySize
(that.fKeySize) { |
| 36 explicit DataId(DataId& that) | |
| 37 : fLoader(that.fLoader), fKey(that.fKey), fKeySize(that.fKeySize) | |
| 38 { | |
| 39 that.fLoader = nullptr; | 36 that.fLoader = nullptr; |
| 40 that.fKey = nullptr; | 37 that.fKey = nullptr; |
| 41 SkDEBUGCODE(that.fKeySize = 0xFFFFFFFF;) | 38 SkDEBUGCODE(that.fKeySize = 0xFFFFFFFF;) |
| 42 } | 39 } |
| 43 | 40 |
| 44 ~DataId() { | 41 ~DataId() { |
| 45 if (fLoader) { | 42 if (fLoader) { |
| 46 fLoader->Release(); | 43 fLoader->Release(); |
| 47 } | 44 } |
| 48 sk_free(fKey); | 45 sk_free(fKey); |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 } else { | 497 } else { |
| 501 localeNameLen = getUserDefaultLocaleNameProc(localeNameStorage, LOCALE_N
AME_MAX_LENGTH); | 498 localeNameLen = getUserDefaultLocaleNameProc(localeNameStorage, LOCALE_N
AME_MAX_LENGTH); |
| 502 if (localeNameLen) { | 499 if (localeNameLen) { |
| 503 localeName = localeNameStorage; | 500 localeName = localeNameStorage; |
| 504 }; | 501 }; |
| 505 } | 502 } |
| 506 | 503 |
| 507 return new SkRemotableFontMgr_DirectWrite(sysFontCollection.get(), localeNam
e, localeNameLen); | 504 return new SkRemotableFontMgr_DirectWrite(sysFontCollection.get(), localeNam
e, localeNameLen); |
| 508 } | 505 } |
| 509 #endif//defined(SK_BUILD_FOR_WIN32) | 506 #endif//defined(SK_BUILD_FOR_WIN32) |
| OLD | NEW |