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

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

Issue 500113002: Require length in sk_wchar_to_string. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add comment. 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.cpp ('k') | src/utils/win/SkDWrite.cpp » ('j') | 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
(...skipping 10 matching lines...) Expand all
21 21
22 //////////////////////////////////////////////////////////////////////////////// 22 ////////////////////////////////////////////////////////////////////////////////
23 // String conversion 23 // String conversion
24 24
25 /** Prefer to use this type to prevent template proliferation. */ 25 /** Prefer to use this type to prevent template proliferation. */
26 typedef SkAutoSTMalloc<16, WCHAR> SkSMallocWCHAR; 26 typedef SkAutoSTMalloc<16, WCHAR> SkSMallocWCHAR;
27 27
28 /** Converts a utf8 string to a WCHAR string. */ 28 /** Converts a utf8 string to a WCHAR string. */
29 HRESULT sk_cstring_to_wchar(const char* skname, SkSMallocWCHAR* name); 29 HRESULT sk_cstring_to_wchar(const char* skname, SkSMallocWCHAR* name);
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 * @param nameLen the number of WCHARs in the name.
33 */
34 HRESULT sk_wchar_to_skstring(WCHAR* name, int nameLen, SkString* skname);
33 35
34 //////////////////////////////////////////////////////////////////////////////// 36 ////////////////////////////////////////////////////////////////////////////////
35 // Locale 37 // Locale
36 38
37 void sk_get_locale_string(IDWriteLocalizedStrings* names, const WCHAR* preferedL ocale, 39 void sk_get_locale_string(IDWriteLocalizedStrings* names, const WCHAR* preferedL ocale,
38 SkString* skname); 40 SkString* skname);
39 41
40 typedef int (WINAPI *SkGetUserDefaultLocaleNameProc)(LPWSTR, int); 42 typedef int (WINAPI *SkGetUserDefaultLocaleNameProc)(LPWSTR, int);
41 HRESULT SkGetGetUserDefaultLocaleNameProc(SkGetUserDefaultLocaleNameProc* proc); 43 HRESULT SkGetGetUserDefaultLocaleNameProc(SkGetUserDefaultLocaleNameProc* proc);
42 44
(...skipping 24 matching lines...) Expand all
67 template<typename T> class AutoTDWriteTable : public AutoDWriteTable { 69 template<typename T> class AutoTDWriteTable : public AutoDWriteTable {
68 public: 70 public:
69 static const UINT32 tag = DWRITE_MAKE_OPENTYPE_TAG(T::TAG0, T::TAG1, T::TAG2 , T::TAG3); 71 static const UINT32 tag = DWRITE_MAKE_OPENTYPE_TAG(T::TAG0, T::TAG1, T::TAG2 , T::TAG3);
70 AutoTDWriteTable(IDWriteFontFace* fontFace) : AutoDWriteTable(fontFace, tag) { } 72 AutoTDWriteTable(IDWriteFontFace* fontFace) : AutoDWriteTable(fontFace, tag) { }
71 73
72 const T* get() const { return reinterpret_cast<const T*>(fData); } 74 const T* get() const { return reinterpret_cast<const T*>(fData); }
73 const T* operator->() const { return reinterpret_cast<const T*>(fData); } 75 const T* operator->() const { return reinterpret_cast<const T*>(fData); }
74 }; 76 };
75 77
76 #endif 78 #endif
OLDNEW
« no previous file with comments | « src/ports/SkTypeface_win_dw.cpp ('k') | src/utils/win/SkDWrite.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698