| 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 "SkFontMgr.h" | 10 #include "SkFontMgr.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 *streamFontFileLoader = new StreamFontFileLoader(stream); | 44 *streamFontFileLoader = new StreamFontFileLoader(stream); |
| 45 if (NULL == streamFontFileLoader) { | 45 if (NULL == streamFontFileLoader) { |
| 46 return E_OUTOFMEMORY; | 46 return E_OUTOFMEMORY; |
| 47 } | 47 } |
| 48 return S_OK; | 48 return S_OK; |
| 49 } | 49 } |
| 50 | 50 |
| 51 SkAutoTDelete<SkStreamAsset> fStream; | 51 SkAutoTDelete<SkStreamAsset> fStream; |
| 52 | 52 |
| 53 private: | 53 private: |
| 54 StreamFontFileLoader(SkStreamAsset* stream) : fRefCount(1), fStream(stream)
{ } | 54 StreamFontFileLoader(SkStreamAsset* stream) : fStream(stream), fRefCount(1)
{ } |
| 55 virtual ~StreamFontFileLoader() { } | 55 virtual ~StreamFontFileLoader() { } |
| 56 | 56 |
| 57 ULONG fRefCount; | 57 ULONG fRefCount; |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 HRESULT StreamFontFileLoader::QueryInterface(REFIID iid, void** ppvObject) { | 60 HRESULT StreamFontFileLoader::QueryInterface(REFIID iid, void** ppvObject) { |
| 61 if (iid == IID_IUnknown || iid == __uuidof(IDWriteFontFileLoader)) { | 61 if (iid == IID_IUnknown || iid == __uuidof(IDWriteFontFileLoader)) { |
| 62 *ppvObject = this; | 62 *ppvObject = this; |
| 63 AddRef(); | 63 AddRef(); |
| 64 return S_OK; | 64 return S_OK; |
| (...skipping 1032 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1097 } | 1097 } |
| 1098 | 1098 |
| 1099 #include "SkFontMgr_indirect.h" | 1099 #include "SkFontMgr_indirect.h" |
| 1100 SK_API SkFontMgr* SkFontMgr_New_DirectWriteRenderer(SkRemotableFontMgr* proxy) { | 1100 SK_API SkFontMgr* SkFontMgr_New_DirectWriteRenderer(SkRemotableFontMgr* proxy) { |
| 1101 SkAutoTUnref<SkFontMgr> impl(SkFontMgr_New_DirectWrite()); | 1101 SkAutoTUnref<SkFontMgr> impl(SkFontMgr_New_DirectWrite()); |
| 1102 if (impl.get() == NULL) { | 1102 if (impl.get() == NULL) { |
| 1103 return NULL; | 1103 return NULL; |
| 1104 } | 1104 } |
| 1105 return SkNEW_ARGS(SkFontMgr_Indirect, (impl.get(), proxy)); | 1105 return SkNEW_ARGS(SkFontMgr_Indirect, (impl.get(), proxy)); |
| 1106 } | 1106 } |
| OLD | NEW |