OLD | NEW |
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 #ifndef SkDWrite_DEFINED | 8 #ifndef SkDWrite_DEFINED |
9 #define SkDWrite_DEFINED | 9 #define SkDWrite_DEFINED |
10 | 10 |
11 #include "SkTemplates.h" | 11 #include "SkTemplates.h" |
12 | 12 |
13 #include <dwrite.h> | 13 #include <dwrite.h> |
| 14 #include <winsdkver.h> |
14 | 15 |
15 class SkString; | 16 class SkString; |
16 | 17 |
17 //////////////////////////////////////////////////////////////////////////////// | 18 //////////////////////////////////////////////////////////////////////////////// |
18 // Factory | 19 // Factory |
19 | 20 |
| 21 #ifndef SK_HAS_DWRITE_1_H |
| 22 #define SK_HAS_DWRITE_1_H (WINVER_MAXVER >= 0x0602) |
| 23 #endif |
| 24 |
20 IDWriteFactory* sk_get_dwrite_factory(); | 25 IDWriteFactory* sk_get_dwrite_factory(); |
21 | 26 |
22 //////////////////////////////////////////////////////////////////////////////// | 27 //////////////////////////////////////////////////////////////////////////////// |
23 // String conversion | 28 // String conversion |
24 | 29 |
25 /** Prefer to use this type to prevent template proliferation. */ | 30 /** Prefer to use this type to prevent template proliferation. */ |
26 typedef SkAutoSTMalloc<16, WCHAR> SkSMallocWCHAR; | 31 typedef SkAutoSTMalloc<16, WCHAR> SkSMallocWCHAR; |
27 | 32 |
28 /** Converts a utf8 string to a WCHAR string. */ | 33 /** Converts a utf8 string to a WCHAR string. */ |
29 HRESULT sk_cstring_to_wchar(const char* skname, SkSMallocWCHAR* name); | 34 HRESULT sk_cstring_to_wchar(const char* skname, SkSMallocWCHAR* name); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 template<typename T> class AutoTDWriteTable : public AutoDWriteTable { | 74 template<typename T> class AutoTDWriteTable : public AutoDWriteTable { |
70 public: | 75 public: |
71 static const UINT32 tag = DWRITE_MAKE_OPENTYPE_TAG(T::TAG0, T::TAG1, T::TAG2
, T::TAG3); | 76 static const UINT32 tag = DWRITE_MAKE_OPENTYPE_TAG(T::TAG0, T::TAG1, T::TAG2
, T::TAG3); |
72 AutoTDWriteTable(IDWriteFontFace* fontFace) : AutoDWriteTable(fontFace, tag)
{ } | 77 AutoTDWriteTable(IDWriteFontFace* fontFace) : AutoDWriteTable(fontFace, tag)
{ } |
73 | 78 |
74 const T* get() const { return reinterpret_cast<const T*>(fData); } | 79 const T* get() const { return reinterpret_cast<const T*>(fData); } |
75 const T* operator->() const { return reinterpret_cast<const T*>(fData); } | 80 const T* operator->() const { return reinterpret_cast<const T*>(fData); } |
76 }; | 81 }; |
77 | 82 |
78 #endif | 83 #endif |
OLD | NEW |