| 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 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 | 424 |
| 425 static bool ShouldUseCompositedScrollingForFrames( | 425 static bool ShouldUseCompositedScrollingForFrames( |
| 426 float device_scale_factor) { | 426 float device_scale_factor) { |
| 427 if (RenderThreadImpl::current() && | 427 if (RenderThreadImpl::current() && |
| 428 !RenderThreadImpl::current()->is_lcd_text_enabled()) | 428 !RenderThreadImpl::current()->is_lcd_text_enabled()) |
| 429 return true; | 429 return true; |
| 430 | 430 |
| 431 return DeviceScaleEnsuresTextQuality(device_scale_factor); | 431 return DeviceScaleEnsuresTextQuality(device_scale_factor); |
| 432 } | 432 } |
| 433 | 433 |
| 434 static bool ShouldUseUniversalAcceleratedCompositingForOverflowScroll() { | |
| 435 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | |
| 436 | |
| 437 if (command_line.HasSwitch( | |
| 438 switches::kDisableUniversalAcceleratedOverflowScroll)) | |
| 439 return false; | |
| 440 | |
| 441 if (command_line.HasSwitch( | |
| 442 switches::kEnableUniversalAcceleratedOverflowScroll)) | |
| 443 return true; | |
| 444 | |
| 445 return false; | |
| 446 } | |
| 447 | |
| 448 static bool ShouldUseTransitionCompositing(float device_scale_factor) { | 434 static bool ShouldUseTransitionCompositing(float device_scale_factor) { |
| 449 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 435 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 450 | 436 |
| 451 if (command_line.HasSwitch(switches::kDisableCompositingForTransition)) | 437 if (command_line.HasSwitch(switches::kDisableCompositingForTransition)) |
| 452 return false; | 438 return false; |
| 453 | 439 |
| 454 if (command_line.HasSwitch(switches::kEnableCompositingForTransition)) | 440 if (command_line.HasSwitch(switches::kEnableCompositingForTransition)) |
| 455 return true; | 441 return true; |
| 456 | 442 |
| 457 // TODO(ajuma): Re-enable this by default for high-DPI once the problem | 443 // TODO(ajuma): Re-enable this by default for high-DPI once the problem |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 738 CompleteInit(); | 724 CompleteInit(); |
| 739 } | 725 } |
| 740 | 726 |
| 741 g_view_map.Get().insert(std::make_pair(webview(), this)); | 727 g_view_map.Get().insert(std::make_pair(webview(), this)); |
| 742 g_routing_id_view_map.Get().insert(std::make_pair(routing_id_, this)); | 728 g_routing_id_view_map.Get().insert(std::make_pair(routing_id_, this)); |
| 743 webview()->setDeviceScaleFactor(device_scale_factor_); | 729 webview()->setDeviceScaleFactor(device_scale_factor_); |
| 744 webview()->settings()->setAcceleratedCompositingForFixedPositionEnabled( | 730 webview()->settings()->setAcceleratedCompositingForFixedPositionEnabled( |
| 745 ShouldUseFixedPositionCompositing(device_scale_factor_)); | 731 ShouldUseFixedPositionCompositing(device_scale_factor_)); |
| 746 webview()->settings()->setAcceleratedCompositingForOverflowScrollEnabled( | 732 webview()->settings()->setAcceleratedCompositingForOverflowScrollEnabled( |
| 747 ShouldUseAcceleratedCompositingForOverflowScroll(device_scale_factor_)); | 733 ShouldUseAcceleratedCompositingForOverflowScroll(device_scale_factor_)); |
| 748 webview()->settings()->setCompositorDrivenAcceleratedScrollingEnabled( | |
| 749 ShouldUseUniversalAcceleratedCompositingForOverflowScroll()); | |
| 750 webview()->settings()->setAcceleratedCompositingForTransitionEnabled( | 734 webview()->settings()->setAcceleratedCompositingForTransitionEnabled( |
| 751 ShouldUseTransitionCompositing(device_scale_factor_)); | 735 ShouldUseTransitionCompositing(device_scale_factor_)); |
| 752 webview()->settings()->setAcceleratedCompositingForFixedRootBackgroundEnabled( | 736 webview()->settings()->setAcceleratedCompositingForFixedRootBackgroundEnabled( |
| 753 ShouldUseAcceleratedFixedRootBackground(device_scale_factor_)); | 737 ShouldUseAcceleratedFixedRootBackground(device_scale_factor_)); |
| 754 webview()->settings()->setCompositedScrollingForFramesEnabled( | 738 webview()->settings()->setCompositedScrollingForFramesEnabled( |
| 755 ShouldUseCompositedScrollingForFrames(device_scale_factor_)); | 739 ShouldUseCompositedScrollingForFrames(device_scale_factor_)); |
| 756 webview()->settings()->setUseExpandedHeuristicsForGpuRasterization( | 740 webview()->settings()->setUseExpandedHeuristicsForGpuRasterization( |
| 757 ShouldUseExpandedHeuristicsForGpuRasterization()); | 741 ShouldUseExpandedHeuristicsForGpuRasterization()); |
| 758 | 742 |
| 759 ApplyWebPreferences(webkit_preferences_, webview()); | 743 ApplyWebPreferences(webkit_preferences_, webview()); |
| (...skipping 3252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4012 std::vector<gfx::Size> sizes; | 3996 std::vector<gfx::Size> sizes; |
| 4013 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 3997 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
| 4014 if (!url.isEmpty()) | 3998 if (!url.isEmpty()) |
| 4015 urls.push_back( | 3999 urls.push_back( |
| 4016 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4000 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
| 4017 } | 4001 } |
| 4018 SendUpdateFaviconURL(urls); | 4002 SendUpdateFaviconURL(urls); |
| 4019 } | 4003 } |
| 4020 | 4004 |
| 4021 } // namespace content | 4005 } // namespace content |
| OLD | NEW |