| 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 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 /** Converts a WCHAR string to a utf8 string. */ | 31 /** Converts a WCHAR string to a utf8 string. */ |
| 32 HRESULT sk_wchar_to_skstring(WCHAR* name, SkString* skname); | 32 HRESULT sk_wchar_to_skstring(WCHAR* name, SkString* skname); |
| 33 | 33 |
| 34 //////////////////////////////////////////////////////////////////////////////// | 34 //////////////////////////////////////////////////////////////////////////////// |
| 35 // Locale | 35 // Locale |
| 36 | 36 |
| 37 void sk_get_locale_string(IDWriteLocalizedStrings* names, const WCHAR* preferedL
ocale, | 37 void sk_get_locale_string(IDWriteLocalizedStrings* names, const WCHAR* preferedL
ocale, |
| 38 SkString* skname); | 38 SkString* skname); |
| 39 | 39 |
| 40 typedef decltype(GetUserDefaultLocaleName)* SkGetUserDefaultLocaleNameProc; | 40 typedef int (WINAPI *SkGetUserDefaultLocaleNameProc)(LPWSTR, int); |
| 41 HRESULT SkGetGetUserDefaultLocaleNameProc(SkGetUserDefaultLocaleNameProc* proc); | 41 HRESULT SkGetGetUserDefaultLocaleNameProc(SkGetUserDefaultLocaleNameProc* proc); |
| 42 | 42 |
| 43 //////////////////////////////////////////////////////////////////////////////// | 43 //////////////////////////////////////////////////////////////////////////////// |
| 44 // Table handling | 44 // Table handling |
| 45 | 45 |
| 46 class AutoDWriteTable { | 46 class AutoDWriteTable { |
| 47 public: | 47 public: |
| 48 AutoDWriteTable(IDWriteFontFace* fontFace, UINT32 beTag) : fFontFace(fontFac
e), fExists(FALSE) { | 48 AutoDWriteTable(IDWriteFontFace* fontFace, UINT32 beTag) : fFontFace(fontFac
e), fExists(FALSE) { |
| 49 // Any errors are ignored, user must check fExists anyway. | 49 // Any errors are ignored, user must check fExists anyway. |
| 50 fontFace->TryGetFontTable(beTag, | 50 fontFace->TryGetFontTable(beTag, |
| (...skipping 16 matching lines...) Expand all Loading... |
| 67 template<typename T> class AutoTDWriteTable : public AutoDWriteTable { | 67 template<typename T> class AutoTDWriteTable : public AutoDWriteTable { |
| 68 public: | 68 public: |
| 69 static const UINT32 tag = DWRITE_MAKE_OPENTYPE_TAG(T::TAG0, T::TAG1, T::TAG2
, T::TAG3); | 69 static const UINT32 tag = DWRITE_MAKE_OPENTYPE_TAG(T::TAG0, T::TAG1, T::TAG2
, T::TAG3); |
| 70 AutoTDWriteTable(IDWriteFontFace* fontFace) : AutoDWriteTable(fontFace, tag)
{ } | 70 AutoTDWriteTable(IDWriteFontFace* fontFace) : AutoDWriteTable(fontFace, tag)
{ } |
| 71 | 71 |
| 72 const T* get() const { return reinterpret_cast<const T*>(fData); } | 72 const T* get() const { return reinterpret_cast<const T*>(fData); } |
| 73 const T* operator->() const { return reinterpret_cast<const T*>(fData); } | 73 const T* operator->() const { return reinterpret_cast<const T*>(fData); } |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 #endif | 76 #endif |
| OLD | NEW |