| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 bool SkDWriteFontFileStream::isAtEnd() const { | 78 bool SkDWriteFontFileStream::isAtEnd() const { |
| 79 return fPos == this->getLength(); | 79 return fPos == this->getLength(); |
| 80 } | 80 } |
| 81 | 81 |
| 82 bool SkDWriteFontFileStream::rewind() { | 82 bool SkDWriteFontFileStream::rewind() { |
| 83 fPos = 0; | 83 fPos = 0; |
| 84 return true; | 84 return true; |
| 85 } | 85 } |
| 86 | 86 |
| 87 SkDWriteFontFileStream* SkDWriteFontFileStream::duplicate() const { | 87 SkDWriteFontFileStream* SkDWriteFontFileStream::duplicate() const { |
| 88 return SkNEW_ARGS(SkDWriteFontFileStream, (fFontFileStream.get())); | 88 return new SkDWriteFontFileStream(fFontFileStream.get()); |
| 89 } | 89 } |
| 90 | 90 |
| 91 size_t SkDWriteFontFileStream::getPosition() const { | 91 size_t SkDWriteFontFileStream::getPosition() const { |
| 92 return fPos; | 92 return fPos; |
| 93 } | 93 } |
| 94 | 94 |
| 95 bool SkDWriteFontFileStream::seek(size_t position) { | 95 bool SkDWriteFontFileStream::seek(size_t position) { |
| 96 size_t length = this->getLength(); | 96 size_t length = this->getLength(); |
| 97 fPos = (position > length) ? length : position; | 97 fPos = (position > length) ? length : position; |
| 98 return true; | 98 return true; |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 HRESULT STDMETHODCALLTYPE SkDWriteFontFileStreamWrapper::GetFileSize(UINT64* fil
eSize) { | 222 HRESULT STDMETHODCALLTYPE SkDWriteFontFileStreamWrapper::GetFileSize(UINT64* fil
eSize) { |
| 223 *fileSize = fStream->getLength(); | 223 *fileSize = fStream->getLength(); |
| 224 return S_OK; | 224 return S_OK; |
| 225 } | 225 } |
| 226 | 226 |
| 227 HRESULT STDMETHODCALLTYPE SkDWriteFontFileStreamWrapper::GetLastWriteTime(UINT64
* lastWriteTime) { | 227 HRESULT STDMETHODCALLTYPE SkDWriteFontFileStreamWrapper::GetLastWriteTime(UINT64
* lastWriteTime) { |
| 228 // The concept of last write time does not apply to this loader. | 228 // The concept of last write time does not apply to this loader. |
| 229 *lastWriteTime = 0; | 229 *lastWriteTime = 0; |
| 230 return E_NOTIMPL; | 230 return E_NOTIMPL; |
| 231 } | 231 } |
| OLD | NEW |