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

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

Issue 940563002: Update DirectWrite streams to SkStreamAsset. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 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 | src/utils/win/SkDWriteFontFileStream.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 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 17 matching lines...) Expand all
28 virtual ULONG STDMETHODCALLTYPE AddRef(); 28 virtual ULONG STDMETHODCALLTYPE AddRef();
29 virtual ULONG STDMETHODCALLTYPE Release(); 29 virtual ULONG STDMETHODCALLTYPE Release();
30 30
31 // IDWriteFontFileLoader methods 31 // IDWriteFontFileLoader methods
32 virtual HRESULT STDMETHODCALLTYPE CreateStreamFromKey( 32 virtual HRESULT STDMETHODCALLTYPE CreateStreamFromKey(
33 void const* fontFileReferenceKey, 33 void const* fontFileReferenceKey,
34 UINT32 fontFileReferenceKeySize, 34 UINT32 fontFileReferenceKeySize,
35 IDWriteFontFileStream** fontFileStream); 35 IDWriteFontFileStream** fontFileStream);
36 36
37 // Takes ownership of stream. 37 // Takes ownership of stream.
38 static HRESULT Create(SkStream* stream, StreamFontFileLoader** streamFontFil eLoader) { 38 static HRESULT Create(SkStreamAsset* stream, StreamFontFileLoader** streamFo ntFileLoader) {
39 *streamFontFileLoader = new StreamFontFileLoader(stream); 39 *streamFontFileLoader = new StreamFontFileLoader(stream);
40 if (NULL == streamFontFileLoader) { 40 if (NULL == streamFontFileLoader) {
41 return E_OUTOFMEMORY; 41 return E_OUTOFMEMORY;
42 } 42 }
43 return S_OK; 43 return S_OK;
44 } 44 }
45 45
46 SkAutoTDelete<SkStream> fStream; 46 SkAutoTDelete<SkStreamAsset> fStream;
47 47
48 private: 48 private:
49 StreamFontFileLoader(SkStream* stream) : fRefCount(1), fStream(stream) { } 49 StreamFontFileLoader(SkStreamAsset* stream) : fRefCount(1), fStream(stream) { }
50 virtual ~StreamFontFileLoader() { } 50 virtual ~StreamFontFileLoader() { }
51 51
52 ULONG fRefCount; 52 ULONG fRefCount;
53 }; 53 };
54 54
55 HRESULT StreamFontFileLoader::QueryInterface(REFIID iid, void** ppvObject) { 55 HRESULT StreamFontFileLoader::QueryInterface(REFIID iid, void** ppvObject) {
56 if (iid == IID_IUnknown || iid == __uuidof(IDWriteFontFileLoader)) { 56 if (iid == IID_IUnknown || iid == __uuidof(IDWriteFontFileLoader)) {
57 *ppvObject = this; 57 *ppvObject = this;
58 AddRef(); 58 AddRef();
59 return S_OK; 59 return S_OK;
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
765 } 765 }
766 766
767 #include "SkFontMgr_indirect.h" 767 #include "SkFontMgr_indirect.h"
768 SK_API SkFontMgr* SkFontMgr_New_DirectWriteRenderer(SkRemotableFontMgr* proxy) { 768 SK_API SkFontMgr* SkFontMgr_New_DirectWriteRenderer(SkRemotableFontMgr* proxy) {
769 SkAutoTUnref<SkFontMgr> impl(SkFontMgr_New_DirectWrite()); 769 SkAutoTUnref<SkFontMgr> impl(SkFontMgr_New_DirectWrite());
770 if (impl.get() == NULL) { 770 if (impl.get() == NULL) {
771 return NULL; 771 return NULL;
772 } 772 }
773 return SkNEW_ARGS(SkFontMgr_Indirect, (impl.get(), proxy)); 773 return SkNEW_ARGS(SkFontMgr_Indirect, (impl.get(), proxy));
774 } 774 }
OLDNEW
« no previous file with comments | « no previous file | src/utils/win/SkDWriteFontFileStream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698