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

Side by Side Diff: src/utils/win/SkDWrite.h

Issue 552383002: Detect presence of dwrite_1.h. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 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/ports/SkTypeface_win_dw.h ('k') | no next file » | 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 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
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
OLDNEW
« no previous file with comments | « src/ports/SkTypeface_win_dw.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698