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

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

Issue 1608733002: Remove ui/gfx/screen_type_delegate.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-4
Patch Set: and another rebase Created 4 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/events/gesture_detection/gesture_provider_config_helper.cc ('k') | ui/gfx/screen.h » ('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 #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
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
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
OLDNEW
« no previous file with comments | « ui/events/gesture_detection/gesture_provider_config_helper.cc ('k') | ui/gfx/screen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698