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

Side by Side Diff: src/utils/win/SkDWriteFontFileStream.cpp

Issue 849103004: Make SkStream *not* ref counted. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase, just in case. Created 5 years, 11 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 | « src/utils/win/SkDWriteFontFileStream.h ('k') | src/views/animated/SkWidgetViews.cpp » ('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 2012 Google Inc. 2 * Copyright 2012 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 "SkTypes.h" 8 #include "SkTypes.h"
9 #include "SkDWriteFontFileStream.h" 9 #include "SkDWriteFontFileStream.h"
10 #include "SkHRESULT.h" 10 #include "SkHRESULT.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 135
136 HRESULT SkDWriteFontFileStreamWrapper::Create(SkStream* stream, SkDWriteFontFile StreamWrapper** streamFontFileStream) { 136 HRESULT SkDWriteFontFileStreamWrapper::Create(SkStream* stream, SkDWriteFontFile StreamWrapper** streamFontFileStream) {
137 *streamFontFileStream = new SkDWriteFontFileStreamWrapper(stream); 137 *streamFontFileStream = new SkDWriteFontFileStreamWrapper(stream);
138 if (NULL == streamFontFileStream) { 138 if (NULL == streamFontFileStream) {
139 return E_OUTOFMEMORY; 139 return E_OUTOFMEMORY;
140 } 140 }
141 return S_OK; 141 return S_OK;
142 } 142 }
143 143
144 SkDWriteFontFileStreamWrapper::SkDWriteFontFileStreamWrapper(SkStream* stream) 144 SkDWriteFontFileStreamWrapper::SkDWriteFontFileStreamWrapper(SkStream* stream)
145 : fRefCount(1), fStream(SkRef(stream)) { 145 : fRefCount(1), fStream(stream) {
146 } 146 }
147 147
148 HRESULT STDMETHODCALLTYPE SkDWriteFontFileStreamWrapper::QueryInterface(REFIID i id, void** ppvObject) { 148 HRESULT STDMETHODCALLTYPE SkDWriteFontFileStreamWrapper::QueryInterface(REFIID i id, void** ppvObject) {
149 if (iid == IID_IUnknown || iid == __uuidof(IDWriteFontFileStream)) { 149 if (iid == IID_IUnknown || iid == __uuidof(IDWriteFontFileStream)) {
150 *ppvObject = this; 150 *ppvObject = this;
151 AddRef(); 151 AddRef();
152 return S_OK; 152 return S_OK;
153 } else { 153 } else {
154 *ppvObject = NULL; 154 *ppvObject = NULL;
155 return E_NOINTERFACE; 155 return E_NOINTERFACE;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 HRESULT STDMETHODCALLTYPE SkDWriteFontFileStreamWrapper::GetFileSize(UINT64* fil eSize) { 223 HRESULT STDMETHODCALLTYPE SkDWriteFontFileStreamWrapper::GetFileSize(UINT64* fil eSize) {
224 *fileSize = fStream->getLength(); 224 *fileSize = fStream->getLength();
225 return S_OK; 225 return S_OK;
226 } 226 }
227 227
228 HRESULT STDMETHODCALLTYPE SkDWriteFontFileStreamWrapper::GetLastWriteTime(UINT64 * lastWriteTime) { 228 HRESULT STDMETHODCALLTYPE SkDWriteFontFileStreamWrapper::GetLastWriteTime(UINT64 * lastWriteTime) {
229 // The concept of last write time does not apply to this loader. 229 // The concept of last write time does not apply to this loader.
230 *lastWriteTime = 0; 230 *lastWriteTime = 0;
231 return E_NOTIMPL; 231 return E_NOTIMPL;
232 } 232 }
OLDNEW
« no previous file with comments | « src/utils/win/SkDWriteFontFileStream.h ('k') | src/views/animated/SkWidgetViews.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698