| OLD | NEW |
| 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 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 | 203 |
| 204 FontRenderParams GetFontRenderParams(const FontRenderParamsQuery& query, | 204 FontRenderParams GetFontRenderParams(const FontRenderParamsQuery& query, |
| 205 std::string* family_out) { | 205 std::string* family_out) { |
| 206 FontRenderParamsQuery actual_query(query); | 206 FontRenderParamsQuery actual_query(query); |
| 207 if (actual_query.device_scale_factor == 0) { | 207 if (actual_query.device_scale_factor == 0) { |
| 208 #if defined(OS_CHROMEOS) | 208 #if defined(OS_CHROMEOS) |
| 209 actual_query.device_scale_factor = device_scale_factor_for_internal_display; | 209 actual_query.device_scale_factor = device_scale_factor_for_internal_display; |
| 210 #else | 210 #else |
| 211 // Linux does not support per-display DPI, so we use a slightly simpler | 211 // Linux does not support per-display DPI, so we use a slightly simpler |
| 212 // code path than on Chrome OS to figure out the device scale factor. | 212 // code path than on Chrome OS to figure out the device scale factor. |
| 213 gfx::Screen* screen = gfx::Screen::GetScreenByType(gfx::SCREEN_TYPE_NATIVE); | 213 gfx::Screen* screen = gfx::Screen::GetScreen(); |
| 214 if (screen) { | 214 if (screen) { |
| 215 gfx::Display display = screen->GetPrimaryDisplay(); | 215 gfx::Display display = screen->GetPrimaryDisplay(); |
| 216 actual_query.device_scale_factor = display.device_scale_factor(); | 216 actual_query.device_scale_factor = display.device_scale_factor(); |
| 217 } | 217 } |
| 218 #endif | 218 #endif |
| 219 } | 219 } |
| 220 const uint32_t hash = HashFontRenderParamsQuery(actual_query); | 220 const uint32_t hash = HashFontRenderParamsQuery(actual_query); |
| 221 SynchronizedCache* synchronized_cache = g_synchronized_cache.Pointer(); | 221 SynchronizedCache* synchronized_cache = g_synchronized_cache.Pointer(); |
| 222 | 222 |
| 223 { | 223 { |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 float GetFontRenderParamsDeviceScaleFactor() { | 283 float GetFontRenderParamsDeviceScaleFactor() { |
| 284 return device_scale_factor_for_internal_display; | 284 return device_scale_factor_for_internal_display; |
| 285 } | 285 } |
| 286 | 286 |
| 287 void SetFontRenderParamsDeviceScaleFactor(float device_scale_factor) { | 287 void SetFontRenderParamsDeviceScaleFactor(float device_scale_factor) { |
| 288 device_scale_factor_for_internal_display = device_scale_factor; | 288 device_scale_factor_for_internal_display = device_scale_factor; |
| 289 } | 289 } |
| 290 #endif | 290 #endif |
| 291 | 291 |
| 292 } // namespace gfx | 292 } // namespace gfx |
| OLD | NEW |