OLD | NEW |
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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 *fragmentStart = NULL; | 181 *fragmentStart = NULL; |
182 *fragmentContext = NULL; | 182 *fragmentContext = NULL; |
183 return E_FAIL; | 183 return E_FAIL; |
184 } | 184 } |
185 | 185 |
186 if (!SkTFitsIn<size_t>(fileOffset + fragmentSize)) { | 186 if (!SkTFitsIn<size_t>(fileOffset + fragmentSize)) { |
187 return E_FAIL; | 187 return E_FAIL; |
188 } | 188 } |
189 | 189 |
190 const void* data = fStream->getMemoryBase(); | 190 const void* data = fStream->getMemoryBase(); |
191 if (NULL != data) { | 191 if (data) { |
192 *fragmentStart = static_cast<BYTE const*>(data) + static_cast<size_t>(fi
leOffset); | 192 *fragmentStart = static_cast<BYTE const*>(data) + static_cast<size_t>(fi
leOffset); |
193 *fragmentContext = NULL; | 193 *fragmentContext = NULL; |
194 | 194 |
195 } else { | 195 } else { |
196 //May be called from multiple threads. | 196 //May be called from multiple threads. |
197 SkAutoMutexAcquire ama(fStreamMutex); | 197 SkAutoMutexAcquire ama(fStreamMutex); |
198 | 198 |
199 *fragmentStart = NULL; | 199 *fragmentStart = NULL; |
200 *fragmentContext = NULL; | 200 *fragmentContext = NULL; |
201 | 201 |
(...skipping 21 matching lines...) Expand all Loading... |
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 } |
OLD | NEW |