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

Side by Side Diff: ui/gfx/win/direct_write.cc

Issue 1958823002: Fix implicit access to raw pointer of scoped_refptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Splitting out change to scoped_refptr to follow up patch. Created 4 years, 7 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
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 "ui/gfx/win/direct_write.h" 5 #include "ui/gfx/win/direct_write.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/field_trial.h" 8 #include "base/metrics/field_trial.h"
9 #include "base/win/registry.h" 9 #include "base/win/registry.h"
10 #include "base/win/scoped_comptr.h" 10 #include "base/win/scoped_comptr.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 tried_dwrite_initialize = true; 47 tried_dwrite_initialize = true;
48 48
49 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 49 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
50 switches::kDisableDirectWriteForUI)) { 50 switches::kDisableDirectWriteForUI)) {
51 return; 51 return;
52 } 52 }
53 53
54 base::win::ScopedComPtr<IDWriteFactory> factory; 54 base::win::ScopedComPtr<IDWriteFactory> factory;
55 CreateDWriteFactory(factory.Receive()); 55 CreateDWriteFactory(factory.Receive());
56 56
57 if (factory == nullptr) 57 if (!factory)
58 return; 58 return;
59 59
60 // The skia call to create a new DirectWrite font manager instance can fail 60 // The skia call to create a new DirectWrite font manager instance can fail
61 // if we are unable to get the system font collection from the DirectWrite 61 // if we are unable to get the system font collection from the DirectWrite
62 // factory. The GetSystemFontCollection method in the IDWriteFactory 62 // factory. The GetSystemFontCollection method in the IDWriteFactory
63 // interface fails with E_INVALIDARG on certain Windows 7 gold versions 63 // interface fails with E_INVALIDARG on certain Windows 7 gold versions
64 // (6.1.7600.*). We should just use GDI in these cases. 64 // (6.1.7600.*). We should just use GDI in these cases.
65 SkFontMgr* direct_write_font_mgr = SkFontMgr_New_DirectWrite(factory.get()); 65 SkFontMgr* direct_write_font_mgr = SkFontMgr_New_DirectWrite(factory.get());
66 if (!direct_write_font_mgr) 66 if (!direct_write_font_mgr)
67 return; 67 return;
68 SetDefaultSkiaFactory(direct_write_font_mgr); 68 SetDefaultSkiaFactory(direct_write_font_mgr);
69 gfx::PlatformFontWin::SetDirectWriteFactory(factory.get()); 69 gfx::PlatformFontWin::SetDirectWriteFactory(factory.get());
70 } 70 }
71 71
72 } // namespace win 72 } // namespace win
73 } // namespace gfx 73 } // namespace gfx
OLDNEW
« no previous file with comments | « net/quic/crypto/quic_crypto_server_config.cc ('k') | ui/gl/gl_image_ozone_native_pixmap_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698