| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 SkString* skname); | 50 SkString* skname); |
| 51 | 51 |
| 52 typedef int (WINAPI *SkGetUserDefaultLocaleNameProc)(LPWSTR, int); | 52 typedef int (WINAPI *SkGetUserDefaultLocaleNameProc)(LPWSTR, int); |
| 53 HRESULT SkGetGetUserDefaultLocaleNameProc(SkGetUserDefaultLocaleNameProc* proc); | 53 HRESULT SkGetGetUserDefaultLocaleNameProc(SkGetUserDefaultLocaleNameProc* proc); |
| 54 | 54 |
| 55 //////////////////////////////////////////////////////////////////////////////// | 55 //////////////////////////////////////////////////////////////////////////////// |
| 56 // Table handling | 56 // Table handling |
| 57 | 57 |
| 58 class AutoDWriteTable { | 58 class AutoDWriteTable { |
| 59 public: | 59 public: |
| 60 AutoDWriteTable(IDWriteFontFace* fontFace, UINT32 beTag) : fFontFace(fontFac
e), fExists(FALSE) { | 60 AutoDWriteTable(IDWriteFontFace* fontFace, UINT32 beTag) : fExists(FALSE), f
FontFace(fontFace) { |
| 61 // Any errors are ignored, user must check fExists anyway. | 61 // Any errors are ignored, user must check fExists anyway. |
| 62 fontFace->TryGetFontTable(beTag, | 62 fontFace->TryGetFontTable(beTag, |
| 63 reinterpret_cast<const void **>(&fData), &fSize, &fLock, &fExists); | 63 reinterpret_cast<const void **>(&fData), &fSize, &fLock, &fExists); |
| 64 } | 64 } |
| 65 ~AutoDWriteTable() { | 65 ~AutoDWriteTable() { |
| 66 if (fExists) { | 66 if (fExists) { |
| 67 fFontFace->ReleaseFontTable(fLock); | 67 fFontFace->ReleaseFontTable(fLock); |
| 68 } | 68 } |
| 69 } | 69 } |
| 70 | 70 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 | 103 |
| 104 fWeight = (DWRITE_FONT_WEIGHT)pattern.weight(); | 104 fWeight = (DWRITE_FONT_WEIGHT)pattern.weight(); |
| 105 fWidth = (DWRITE_FONT_STRETCH)pattern.width(); | 105 fWidth = (DWRITE_FONT_STRETCH)pattern.width(); |
| 106 } | 106 } |
| 107 DWRITE_FONT_STYLE fSlant; | 107 DWRITE_FONT_STYLE fSlant; |
| 108 DWRITE_FONT_WEIGHT fWeight; | 108 DWRITE_FONT_WEIGHT fWeight; |
| 109 DWRITE_FONT_STRETCH fWidth; | 109 DWRITE_FONT_STRETCH fWidth; |
| 110 }; | 110 }; |
| 111 | 111 |
| 112 #endif | 112 #endif |
| OLD | NEW |