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

Side by Side Diff: content/child/font_warmup_win.cc

Issue 2618443002: Remove use of legacy SkFontMgr factories. (Closed)
Patch Set: Forward declare when possible. Created 3 years, 11 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 | « content/child/font_warmup_win.h ('k') | content/child/font_warmup_win_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/child/font_warmup_win.h" 5 #include "content/child/font_warmup_win.h"
6 6
7 #include <dwrite.h> 7 #include <dwrite.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <map> 9 #include <map>
10 10
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 L"dwrite.dll", service_provider_dll, "StartServiceW", StartServiceWPatch); 409 L"dwrite.dll", service_provider_dll, "StartServiceW", StartServiceWPatch);
410 DCHECK(patched == 0); 410 DCHECK(patched == 0);
411 411
412 patched = g_iat_patch_nt_connect_port.Patch( 412 patched = g_iat_patch_nt_connect_port.Patch(
413 L"dwrite.dll", "ntdll.dll", "NtAlpcConnectPort", NtALpcConnectPortPatch); 413 L"dwrite.dll", "ntdll.dll", "NtAlpcConnectPort", NtALpcConnectPortPatch);
414 DCHECK(patched == 0); 414 DCHECK(patched == 0);
415 } 415 }
416 416
417 GdiFontPatchData* PatchGdiFontEnumeration(const base::FilePath& path) { 417 GdiFontPatchData* PatchGdiFontEnumeration(const base::FilePath& path) {
418 if (!g_warmup_fontmgr) 418 if (!g_warmup_fontmgr)
419 g_warmup_fontmgr = SkFontMgr_New_DirectWrite(); 419 g_warmup_fontmgr = SkFontMgr_New_DirectWrite().release();
420 DCHECK(g_warmup_fontmgr); 420 DCHECK(g_warmup_fontmgr);
421 return new GdiFontPatchDataImpl(path); 421 return new GdiFontPatchDataImpl(path);
422 } 422 }
423 423
424 size_t GetEmulatedGdiHandleCountForTesting() { 424 size_t GetEmulatedGdiHandleCountForTesting() {
425 return g_fake_gdi_object_factory.Get().GetObjectCount(); 425 return g_fake_gdi_object_factory.Get().GetObjectCount();
426 } 426 }
427 427
428 void ResetEmulatedGdiHandlesForTesting() { 428 void ResetEmulatedGdiHandlesForTesting() {
429 g_fake_gdi_object_factory.Get().ResetObjectHandles(); 429 g_fake_gdi_object_factory.Get().ResetObjectHandles();
430 } 430 }
431 431
432 void SetPreSandboxWarmupFontMgrForTesting(SkFontMgr* fontmgr) { 432 void SetPreSandboxWarmupFontMgrForTesting(sk_sp<SkFontMgr> fontmgr) {
433 g_warmup_fontmgr = fontmgr; 433 SkSafeUnref(g_warmup_fontmgr);
434 g_warmup_fontmgr = fontmgr.release();
434 } 435 }
435 436
436 } // namespace content 437 } // namespace content
OLDNEW
« no previous file with comments | « content/child/font_warmup_win.h ('k') | content/child/font_warmup_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698