| 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 #include "SkDWrite.h" | 8 #include "SkDWrite.h" |
| 9 #include "SkDWriteFontFileStream.h" | 9 #include "SkDWriteFontFileStream.h" |
| 10 #include "SkFontMgr.h" | 10 #include "SkFontMgr.h" |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 same = (iunkA.get() == iunkB.get()); | 324 same = (iunkA.get() == iunkB.get()); |
| 325 return S_OK; | 325 return S_OK; |
| 326 } | 326 } |
| 327 | 327 |
| 328 struct ProtoDWriteTypeface { | 328 struct ProtoDWriteTypeface { |
| 329 IDWriteFontFace* fDWriteFontFace; | 329 IDWriteFontFace* fDWriteFontFace; |
| 330 IDWriteFont* fDWriteFont; | 330 IDWriteFont* fDWriteFont; |
| 331 IDWriteFontFamily* fDWriteFontFamily; | 331 IDWriteFontFamily* fDWriteFontFamily; |
| 332 }; | 332 }; |
| 333 | 333 |
| 334 static bool FindByDWriteFont(SkTypeface* cached, const SkFontStyle&, void* ctx)
{ | 334 static bool FindByDWriteFont(SkTypeface* cached, SkTypeface::Style, void* ctx) { |
| 335 DWriteFontTypeface* cshFace = reinterpret_cast<DWriteFontTypeface*>(cached); | 335 DWriteFontTypeface* cshFace = reinterpret_cast<DWriteFontTypeface*>(cached); |
| 336 ProtoDWriteTypeface* ctxFace = reinterpret_cast<ProtoDWriteTypeface*>(ctx); | 336 ProtoDWriteTypeface* ctxFace = reinterpret_cast<ProtoDWriteTypeface*>(ctx); |
| 337 bool same; | 337 bool same; |
| 338 | 338 |
| 339 //Check to see if the two fonts are identical. | 339 //Check to see if the two fonts are identical. |
| 340 HRB(are_same(cshFace->fDWriteFont.get(), ctxFace->fDWriteFont, same)); | 340 HRB(are_same(cshFace->fDWriteFont.get(), ctxFace->fDWriteFont, same)); |
| 341 if (same) { | 341 if (same) { |
| 342 return true; | 342 return true; |
| 343 } | 343 } |
| 344 | 344 |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 755 } | 755 } |
| 756 | 756 |
| 757 #include "SkFontMgr_indirect.h" | 757 #include "SkFontMgr_indirect.h" |
| 758 SK_API SkFontMgr* SkFontMgr_New_DirectWriteRenderer(SkRemotableFontMgr* proxy) { | 758 SK_API SkFontMgr* SkFontMgr_New_DirectWriteRenderer(SkRemotableFontMgr* proxy) { |
| 759 SkAutoTUnref<SkFontMgr> impl(SkFontMgr_New_DirectWrite()); | 759 SkAutoTUnref<SkFontMgr> impl(SkFontMgr_New_DirectWrite()); |
| 760 if (impl.get() == NULL) { | 760 if (impl.get() == NULL) { |
| 761 return NULL; | 761 return NULL; |
| 762 } | 762 } |
| 763 return SkNEW_ARGS(SkFontMgr_Indirect, (impl.get(), proxy)); | 763 return SkNEW_ARGS(SkFontMgr_Indirect, (impl.get(), proxy)); |
| 764 } | 764 } |
| OLD | NEW |