Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
| 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 #include "SkTypes.h" | 8 #include "SkTypes.h" |
| 9 #if defined(SK_BUILD_FOR_WIN32) | 9 #if defined(SK_BUILD_FOR_WIN32) |
| 10 | 10 |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 317 | 317 |
| 318 /** | 318 /** |
| 319 * This guy is public. It first searches the cache, and if a match is not found , | 319 * This guy is public. It first searches the cache, and if a match is not found , |
| 320 * it creates a new face. | 320 * it creates a new face. |
| 321 */ | 321 */ |
| 322 SkTypeface* SkCreateTypefaceFromLOGFONT(const LOGFONT& origLF) { | 322 SkTypeface* SkCreateTypefaceFromLOGFONT(const LOGFONT& origLF) { |
| 323 LOGFONT lf = origLF; | 323 LOGFONT lf = origLF; |
| 324 make_canonical(&lf); | 324 make_canonical(&lf); |
| 325 SkTypeface* face = SkTypefaceCache::FindByProcAndRef(FindByLogFont, &lf); | 325 SkTypeface* face = SkTypefaceCache::FindByProcAndRef(FindByLogFont, &lf); |
| 326 if (nullptr == face) { | 326 if (nullptr == face) { |
| 327 lf.lfWidth = 0; | |
|
bungeman-skia
2016/03/22 20:16:43
Now that I look at what is actually happening and
Mikus
2016/03/24 12:08:26
Acknowledged.
| |
| 327 face = LogFontTypeface::Create(lf); | 328 face = LogFontTypeface::Create(lf); |
| 328 SkTypefaceCache::Add(face, get_style(lf)); | 329 SkTypefaceCache::Add(face, get_style(lf)); |
| 329 } | 330 } |
| 330 return face; | 331 return face; |
| 331 } | 332 } |
| 332 | 333 |
| 333 /** | 334 /** |
| 334 * The created SkTypeface takes ownership of fontMemResource. | 335 * The created SkTypeface takes ownership of fontMemResource. |
| 335 */ | 336 */ |
| 336 SkTypeface* SkCreateFontMemResourceTypefaceFromLOGFONT(const LOGFONT& origLF, HA NDLE fontMemResource) { | 337 SkTypeface* SkCreateFontMemResourceTypefaceFromLOGFONT(const LOGFONT& origLF, HA NDLE fontMemResource) { |
| (...skipping 2171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2508 | 2509 |
| 2509 private: | 2510 private: |
| 2510 SkTDArray<ENUMLOGFONTEX> fLogFontArray; | 2511 SkTDArray<ENUMLOGFONTEX> fLogFontArray; |
| 2511 }; | 2512 }; |
| 2512 | 2513 |
| 2513 /////////////////////////////////////////////////////////////////////////////// | 2514 /////////////////////////////////////////////////////////////////////////////// |
| 2514 | 2515 |
| 2515 SkFontMgr* SkFontMgr_New_GDI() { return new SkFontMgrGDI; } | 2516 SkFontMgr* SkFontMgr_New_GDI() { return new SkFontMgrGDI; } |
| 2516 | 2517 |
| 2517 #endif//defined(SK_BUILD_FOR_WIN32) | 2518 #endif//defined(SK_BUILD_FOR_WIN32) |
| OLD | NEW |