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 #ifndef SkDWriteFontFileStream_DEFINED | 8 #ifndef SkDWriteFontFileStream_DEFINED |
9 #define SkDWriteFontFileStream_DEFINED | 9 #define SkDWriteFontFileStream_DEFINED |
10 | 10 |
11 #include "SkTypes.h" | 11 #include "SkTypes.h" |
12 | 12 |
13 #include "SkMutex.h" | 13 #include "SkMutex.h" |
14 #include "SkStream.h" | 14 #include "SkStream.h" |
15 #include "SkTScopedComPtr.h" | 15 #include "SkTScopedComPtr.h" |
16 | 16 |
17 #include <dwrite.h> | 17 #include <dwrite.h> |
18 | 18 |
19 /** | 19 /** |
20 * An SkStream backed by an IDWriteFontFileStream. | 20 * An SkStream backed by an IDWriteFontFileStream. |
21 * This allows Skia code to read an IDWriteFontFileStream. | 21 * This allows Skia code to read an IDWriteFontFileStream. |
22 */ | 22 */ |
23 class SkDWriteFontFileStream : public SkStreamMemory { | 23 class SkDWriteFontFileStream : public SkStreamMemory { |
24 public: | 24 public: |
25 explicit SkDWriteFontFileStream(IDWriteFontFileStream* fontFileStream); | 25 explicit SkDWriteFontFileStream(IDWriteFontFileStream* fontFileStream); |
26 virtual ~SkDWriteFontFileStream(); | 26 virtual ~SkDWriteFontFileStream(); |
27 | 27 |
28 size_t read(void* buffer, size_t size) SK_OVERRIDE; | 28 size_t read(void* buffer, size_t size) override; |
29 bool isAtEnd() const SK_OVERRIDE; | 29 bool isAtEnd() const override; |
30 bool rewind() SK_OVERRIDE; | 30 bool rewind() override; |
31 SkDWriteFontFileStream* duplicate() const SK_OVERRIDE; | 31 SkDWriteFontFileStream* duplicate() const override; |
32 size_t getPosition() const SK_OVERRIDE; | 32 size_t getPosition() const override; |
33 bool seek(size_t position) SK_OVERRIDE; | 33 bool seek(size_t position) override; |
34 bool move(long offset) SK_OVERRIDE; | 34 bool move(long offset) override; |
35 SkDWriteFontFileStream* fork() const SK_OVERRIDE; | 35 SkDWriteFontFileStream* fork() const override; |
36 size_t getLength() const SK_OVERRIDE; | 36 size_t getLength() const override; |
37 const void* getMemoryBase() SK_OVERRIDE; | 37 const void* getMemoryBase() override; |
38 | 38 |
39 private: | 39 private: |
40 SkTScopedComPtr<IDWriteFontFileStream> fFontFileStream; | 40 SkTScopedComPtr<IDWriteFontFileStream> fFontFileStream; |
41 size_t fPos; | 41 size_t fPos; |
42 const void* fLockedMemory; | 42 const void* fLockedMemory; |
43 void* fFragmentLock; | 43 void* fFragmentLock; |
44 }; | 44 }; |
45 | 45 |
46 /** | 46 /** |
47 * An IDWriteFontFileStream backed by an SkStream. | 47 * An IDWriteFontFileStream backed by an SkStream. |
(...skipping 22 matching lines...) Expand all Loading... |
70 | 70 |
71 private: | 71 private: |
72 explicit SkDWriteFontFileStreamWrapper(SkStreamAsset* stream); | 72 explicit SkDWriteFontFileStreamWrapper(SkStreamAsset* stream); |
73 virtual ~SkDWriteFontFileStreamWrapper() { } | 73 virtual ~SkDWriteFontFileStreamWrapper() { } |
74 | 74 |
75 ULONG fRefCount; | 75 ULONG fRefCount; |
76 SkAutoTDelete<SkStreamAsset> fStream; | 76 SkAutoTDelete<SkStreamAsset> fStream; |
77 SkMutex fStreamMutex; | 77 SkMutex fStreamMutex; |
78 }; | 78 }; |
79 #endif | 79 #endif |
OLD | NEW |