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

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

Issue 851503003: Update from https://crrev.com/311076 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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 | « ui/compositor/dip_util.cc ('k') | ui/gl/gl_gl_api_implementation.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 "ui/gfx/font_list_impl.h" 5 #include "ui/gfx/font_list_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 97
98 FontListImpl::FontListImpl(const std::vector<Font>& fonts) 98 FontListImpl::FontListImpl(const std::vector<Font>& fonts)
99 : fonts_(fonts), 99 : fonts_(fonts),
100 common_height_(-1), 100 common_height_(-1),
101 common_baseline_(-1), 101 common_baseline_(-1),
102 font_style_(-1), 102 font_style_(-1),
103 font_size_(-1) { 103 font_size_(-1) {
104 DCHECK(!fonts.empty()); 104 DCHECK(!fonts.empty());
105 font_style_ = fonts[0].GetStyle(); 105 font_style_ = fonts[0].GetStyle();
106 font_size_ = fonts[0].GetFontSize(); 106 font_size_ = fonts[0].GetFontSize();
107 #if DCHECK_IS_ON 107 #if DCHECK_IS_ON()
108 for (size_t i = 1; i < fonts.size(); ++i) { 108 for (size_t i = 1; i < fonts.size(); ++i) {
109 DCHECK_EQ(fonts[i].GetStyle(), font_style_); 109 DCHECK_EQ(fonts[i].GetStyle(), font_style_);
110 DCHECK_EQ(fonts[i].GetFontSize(), font_size_); 110 DCHECK_EQ(fonts[i].GetFontSize(), font_size_);
111 } 111 }
112 #endif 112 #endif
113 } 113 }
114 114
115 FontListImpl::FontListImpl(const Font& font) 115 FontListImpl::FontListImpl(const Font& font)
116 : common_height_(-1), 116 : common_height_(-1),
117 common_baseline_(-1), 117 common_baseline_(-1),
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 font_style_ = fonts_[0].GetStyle(); 239 font_style_ = fonts_[0].GetStyle();
240 font_size_ = fonts_[0].GetFontSize(); 240 font_size_ = fonts_[0].GetFontSize();
241 } else { 241 } else {
242 std::vector<std::string> font_names; 242 std::vector<std::string> font_names;
243 ParseFontDescriptionString(font_description_string_, &font_names, 243 ParseFontDescriptionString(font_description_string_, &font_names,
244 &font_style_, &font_size_); 244 &font_style_, &font_size_);
245 } 245 }
246 } 246 }
247 247
248 } // namespace gfx 248 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/compositor/dip_util.cc ('k') | ui/gl/gl_gl_api_implementation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698