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

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 1293083003: Make the LCD text device scale factor threshold 1.5 inclusive (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 4 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 "content/renderer/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 } 354 }
355 } 355 }
356 356
357 // Returns true if the device scale is high enough that losing subpixel 357 // Returns true if the device scale is high enough that losing subpixel
358 // antialiasing won't have a noticeable effect on text quality. 358 // antialiasing won't have a noticeable effect on text quality.
359 static bool DeviceScaleEnsuresTextQuality(float device_scale_factor) { 359 static bool DeviceScaleEnsuresTextQuality(float device_scale_factor) {
360 #if defined(OS_ANDROID) 360 #if defined(OS_ANDROID)
361 // On Android, we never have subpixel antialiasing. 361 // On Android, we never have subpixel antialiasing.
362 return true; 362 return true;
363 #else 363 #else
364 return device_scale_factor > 1.5f; 364 // 1.5 is a common touchscreen tablet device scale factor. For such
365 // devices main thread antialiasing is a heavy burden.
366 return device_scale_factor >= 1.5f;
365 #endif 367 #endif
366 368
367 } 369 }
368 370
369 static bool PreferCompositingToLCDText(CompositorDependencies* compositor_deps, 371 static bool PreferCompositingToLCDText(CompositorDependencies* compositor_deps,
370 float device_scale_factor) { 372 float device_scale_factor) {
371 const base::CommandLine& command_line = 373 const base::CommandLine& command_line =
372 *base::CommandLine::ForCurrentProcess(); 374 *base::CommandLine::ForCurrentProcess();
373 if (command_line.HasSwitch(switches::kDisablePreferCompositingToLCDText)) 375 if (command_line.HasSwitch(switches::kDisablePreferCompositingToLCDText))
374 return false; 376 return false;
(...skipping 3457 matching lines...) Expand 10 before | Expand all | Expand 10 after
3832 std::vector<gfx::Size> sizes; 3834 std::vector<gfx::Size> sizes;
3833 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); 3835 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes);
3834 if (!url.isEmpty()) 3836 if (!url.isEmpty())
3835 urls.push_back( 3837 urls.push_back(
3836 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); 3838 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes));
3837 } 3839 }
3838 SendUpdateFaviconURL(urls); 3840 SendUpdateFaviconURL(urls);
3839 } 3841 }
3840 3842
3841 } // namespace content 3843 } // namespace content
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