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

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

Issue 1223153003: Move JoinString to the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: windows Created 5 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
« no previous file with comments | « ui/gfx/font_list_impl.cc ('k') | ui/gfx/text_elider_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 (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_render_params.h" 5 #include "ui/gfx/font_render_params.h"
6 6
7 #include <fontconfig/fontconfig.h> 7 #include <fontconfig/fontconfig.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/containers/mru_cache.h" 10 #include "base/containers/mru_cache.h"
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 } 185 }
186 186
187 return true; 187 return true;
188 } 188 }
189 189
190 // Serialize |query| into a string and hash it to a value suitable for use as a 190 // Serialize |query| into a string and hash it to a value suitable for use as a
191 // cache key. 191 // cache key.
192 uint32 HashFontRenderParamsQuery(const FontRenderParamsQuery& query) { 192 uint32 HashFontRenderParamsQuery(const FontRenderParamsQuery& query) {
193 return base::Hash(base::StringPrintf( 193 return base::Hash(base::StringPrintf(
194 "%d|%d|%d|%s|%f", query.pixel_size, query.point_size, query.style, 194 "%d|%d|%d|%s|%f", query.pixel_size, query.point_size, query.style,
195 JoinString(query.families, ',').c_str(), query.device_scale_factor)); 195 base::JoinString(query.families, ",").c_str(),
196 query.device_scale_factor));
196 } 197 }
197 198
198 } // namespace 199 } // namespace
199 200
200 FontRenderParams GetFontRenderParams(const FontRenderParamsQuery& query, 201 FontRenderParams GetFontRenderParams(const FontRenderParamsQuery& query,
201 std::string* family_out) { 202 std::string* family_out) {
202 FontRenderParamsQuery actual_query(query); 203 FontRenderParamsQuery actual_query(query);
203 if (actual_query.device_scale_factor == 0) { 204 if (actual_query.device_scale_factor == 0) {
204 #if defined(OS_CHROMEOS) 205 #if defined(OS_CHROMEOS)
205 actual_query.device_scale_factor = device_scale_factor_for_internal_display; 206 actual_query.device_scale_factor = device_scale_factor_for_internal_display;
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 float GetFontRenderParamsDeviceScaleFactor() { 280 float GetFontRenderParamsDeviceScaleFactor() {
280 return device_scale_factor_for_internal_display; 281 return device_scale_factor_for_internal_display;
281 } 282 }
282 283
283 void SetFontRenderParamsDeviceScaleFactor(float device_scale_factor) { 284 void SetFontRenderParamsDeviceScaleFactor(float device_scale_factor) {
284 device_scale_factor_for_internal_display = device_scale_factor; 285 device_scale_factor_for_internal_display = device_scale_factor;
285 } 286 }
286 #endif 287 #endif
287 288
288 } // namespace gfx 289 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/font_list_impl.cc ('k') | ui/gfx/text_elider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698