| 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 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 static bool ShouldUseAcceleratedCompositingForScrollableFrames( | 454 static bool ShouldUseAcceleratedCompositingForScrollableFrames( |
| 455 float device_scale_factor) { | 455 float device_scale_factor) { |
| 456 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 456 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 457 | 457 |
| 458 if (command_line.HasSwitch(switches::kDisableAcceleratedScrollableFrames)) | 458 if (command_line.HasSwitch(switches::kDisableAcceleratedScrollableFrames)) |
| 459 return false; | 459 return false; |
| 460 | 460 |
| 461 if (command_line.HasSwitch(switches::kEnableAcceleratedScrollableFrames)) | 461 if (command_line.HasSwitch(switches::kEnableAcceleratedScrollableFrames)) |
| 462 return true; | 462 return true; |
| 463 | 463 |
| 464 if (!cc::switches::IsLCDTextEnabled()) | 464 if (!RenderThreadImpl::current()->is_lcd_text_enabled()) |
| 465 return true; | 465 return true; |
| 466 | 466 |
| 467 return DeviceScaleEnsuresTextQuality(device_scale_factor); | 467 return DeviceScaleEnsuresTextQuality(device_scale_factor); |
| 468 } | 468 } |
| 469 | 469 |
| 470 static bool ShouldUseCompositedScrollingForFrames( | 470 static bool ShouldUseCompositedScrollingForFrames( |
| 471 float device_scale_factor) { | 471 float device_scale_factor) { |
| 472 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 472 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 473 | 473 |
| 474 if (command_line.HasSwitch(switches::kDisableCompositedScrollingForFrames)) | 474 if (command_line.HasSwitch(switches::kDisableCompositedScrollingForFrames)) |
| 475 return false; | 475 return false; |
| 476 | 476 |
| 477 if (command_line.HasSwitch(switches::kEnableCompositedScrollingForFrames)) | 477 if (command_line.HasSwitch(switches::kEnableCompositedScrollingForFrames)) |
| 478 return true; | 478 return true; |
| 479 | 479 |
| 480 if (!cc::switches::IsLCDTextEnabled()) | 480 if (!RenderThreadImpl::current()->is_lcd_text_enabled()) |
| 481 return true; | 481 return true; |
| 482 | 482 |
| 483 return DeviceScaleEnsuresTextQuality(device_scale_factor); | 483 return DeviceScaleEnsuresTextQuality(device_scale_factor); |
| 484 } | 484 } |
| 485 | 485 |
| 486 static bool ShouldUseUniversalAcceleratedCompositingForOverflowScroll() { | 486 static bool ShouldUseUniversalAcceleratedCompositingForOverflowScroll() { |
| 487 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 487 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 488 | 488 |
| 489 if (command_line.HasSwitch( | 489 if (command_line.HasSwitch( |
| 490 switches::kDisableUniversalAcceleratedOverflowScroll)) | 490 switches::kDisableUniversalAcceleratedOverflowScroll)) |
| (...skipping 4711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5202 for (size_t i = 0; i < icon_urls.size(); i++) { | 5202 for (size_t i = 0; i < icon_urls.size(); i++) { |
| 5203 WebURL url = icon_urls[i].iconURL(); | 5203 WebURL url = icon_urls[i].iconURL(); |
| 5204 if (!url.isEmpty()) | 5204 if (!url.isEmpty()) |
| 5205 urls.push_back(FaviconURL(url, | 5205 urls.push_back(FaviconURL(url, |
| 5206 ToFaviconType(icon_urls[i].iconType()))); | 5206 ToFaviconType(icon_urls[i].iconType()))); |
| 5207 } | 5207 } |
| 5208 SendUpdateFaviconURL(urls); | 5208 SendUpdateFaviconURL(urls); |
| 5209 } | 5209 } |
| 5210 | 5210 |
| 5211 } // namespace content | 5211 } // namespace content |
| OLD | NEW |