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

Side by Side Diff: ui/gfx/font_list.cc

Issue 382273002: ui/gfx: Allow for font-specific rendering settings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: diff against https://codereview.chromium.org/387743002/ Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/font_list.h" 5 #include "ui/gfx/font_list.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "ui/gfx/font_list_impl.h" 9 #include "ui/gfx/font_list_impl.h"
10 10
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 } 91 }
92 92
93 const std::string& FontList::GetFontDescriptionString() const { 93 const std::string& FontList::GetFontDescriptionString() const {
94 return impl_->GetFontDescriptionString(); 94 return impl_->GetFontDescriptionString();
95 } 95 }
96 96
97 int FontList::GetFontSize() const { 97 int FontList::GetFontSize() const {
98 return impl_->GetFontSize(); 98 return impl_->GetFontSize();
99 } 99 }
100 100
101 const FontRenderParams& FontList::GetFontRenderParams() const {
102 return impl_->GetFontRenderParams();
103 }
104
101 const std::vector<Font>& FontList::GetFonts() const { 105 const std::vector<Font>& FontList::GetFonts() const {
102 return impl_->GetFonts(); 106 return impl_->GetFonts();
103 } 107 }
104 108
105 const Font& FontList::GetPrimaryFont() const { 109 const Font& FontList::GetPrimaryFont() const {
106 return impl_->GetPrimaryFont(); 110 return impl_->GetPrimaryFont();
107 } 111 }
108 112
109 FontList::FontList(FontListImpl* impl) : impl_(impl) {} 113 FontList::FontList(FontListImpl* impl) : impl_(impl) {}
110 114
111 // static 115 // static
112 const scoped_refptr<FontListImpl>& FontList::GetDefaultImpl() { 116 const scoped_refptr<FontListImpl>& FontList::GetDefaultImpl() {
113 // SetDefaultFontDescription() must be called and the default font description 117 // SetDefaultFontDescription() must be called and the default font description
114 // must be set earlier than any call of this function. 118 // must be set earlier than any call of this function.
115 DCHECK(!(g_default_font_description == NULL)) // != is not overloaded. 119 DCHECK(!(g_default_font_description == NULL)) // != is not overloaded.
116 << "SetDefaultFontDescription has not been called."; 120 << "SetDefaultFontDescription has not been called.";
117 121
118 if (!g_default_impl_initialized) { 122 if (!g_default_impl_initialized) {
119 g_default_impl.Get() = 123 g_default_impl.Get() =
120 g_default_font_description.Get().empty() ? 124 g_default_font_description.Get().empty() ?
121 new FontListImpl(Font()) : 125 new FontListImpl(Font()) :
122 new FontListImpl(g_default_font_description.Get()); 126 new FontListImpl(g_default_font_description.Get());
123 g_default_impl_initialized = true; 127 g_default_impl_initialized = true;
124 } 128 }
125 129
126 return g_default_impl.Get(); 130 return g_default_impl.Get();
127 } 131 }
128 132
129 } // namespace gfx 133 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698