| 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 "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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |