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

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

Issue 796623005: Increase the cache size of fontconfig queries. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.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 | « no previous file | no next file » | 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 13 matching lines...) Expand all
24 24
25 namespace { 25 namespace {
26 26
27 #if defined(OS_CHROMEOS) 27 #if defined(OS_CHROMEOS)
28 // A device scale factor for an internal display (if any) 28 // A device scale factor for an internal display (if any)
29 // that is used to determine if subpixel positioning should be used. 29 // that is used to determine if subpixel positioning should be used.
30 float device_scale_factor_for_internal_display = 1.0f; 30 float device_scale_factor_for_internal_display = 1.0f;
31 #endif 31 #endif
32 32
33 // Number of recent GetFontRenderParams() results to cache. 33 // Number of recent GetFontRenderParams() results to cache.
34 const size_t kCacheSize = 64; 34 const size_t kCacheSize = 256;
35 35
36 // Cached result from a call to GetFontRenderParams(). 36 // Cached result from a call to GetFontRenderParams().
37 struct QueryResult { 37 struct QueryResult {
38 QueryResult(const FontRenderParams& params, const std::string& family) 38 QueryResult(const FontRenderParams& params, const std::string& family)
39 : params(params), 39 : params(params),
40 family(family) { 40 family(family) {
41 } 41 }
42 ~QueryResult() {} 42 ~QueryResult() {}
43 43
44 FontRenderParams params; 44 FontRenderParams params;
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 float GetFontRenderParamsDeviceScaleFactor() { 284 float GetFontRenderParamsDeviceScaleFactor() {
285 return device_scale_factor_for_internal_display; 285 return device_scale_factor_for_internal_display;
286 } 286 }
287 287
288 void SetFontRenderParamsDeviceScaleFactor(float device_scale_factor) { 288 void SetFontRenderParamsDeviceScaleFactor(float device_scale_factor) {
289 device_scale_factor_for_internal_display = device_scale_factor; 289 device_scale_factor_for_internal_display = device_scale_factor;
290 } 290 }
291 #endif 291 #endif
292 292
293 } // namespace gfx 293 } // namespace gfx
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698