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 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 | 632 |
633 if (command_line.HasSwitch(switches::kEnableCompositedScrollingForFrames)) | 633 if (command_line.HasSwitch(switches::kEnableCompositedScrollingForFrames)) |
634 return true; | 634 return true; |
635 | 635 |
636 if (!cc::switches::IsLCDTextEnabled()) | 636 if (!cc::switches::IsLCDTextEnabled()) |
637 return true; | 637 return true; |
638 | 638 |
639 return DeviceScaleEnsuresTextQuality(device_scale_factor); | 639 return DeviceScaleEnsuresTextQuality(device_scale_factor); |
640 } | 640 } |
641 | 641 |
| 642 static bool ShouldUseUniversalAcceleratedCompositingForOverflowScroll() { |
| 643 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 644 |
| 645 if (command_line.HasSwitch( |
| 646 switches::kDisableUniversalAcceleratedOverflowScroll)) |
| 647 return false; |
| 648 |
| 649 if (command_line.HasSwitch( |
| 650 switches::kEnableUniversalAcceleratedOverflowScroll)) |
| 651 return true; |
| 652 |
| 653 return false; |
| 654 } |
| 655 |
642 static bool ShouldUseTransitionCompositing(float device_scale_factor) { | 656 static bool ShouldUseTransitionCompositing(float device_scale_factor) { |
643 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 657 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
644 | 658 |
645 if (command_line.HasSwitch(switches::kDisableCompositingForTransition)) | 659 if (command_line.HasSwitch(switches::kDisableCompositingForTransition)) |
646 return false; | 660 return false; |
647 | 661 |
648 if (command_line.HasSwitch(switches::kEnableCompositingForTransition)) | 662 if (command_line.HasSwitch(switches::kEnableCompositingForTransition)) |
649 return true; | 663 return true; |
650 | 664 |
651 // TODO(ajuma): Re-enable this by default for high-DPI once the problem | 665 // TODO(ajuma): Re-enable this by default for high-DPI once the problem |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
921 CompleteInit(); | 935 CompleteInit(); |
922 } | 936 } |
923 | 937 |
924 g_view_map.Get().insert(std::make_pair(webview(), this)); | 938 g_view_map.Get().insert(std::make_pair(webview(), this)); |
925 g_routing_id_view_map.Get().insert(std::make_pair(routing_id_, this)); | 939 g_routing_id_view_map.Get().insert(std::make_pair(routing_id_, this)); |
926 webview()->setDeviceScaleFactor(device_scale_factor_); | 940 webview()->setDeviceScaleFactor(device_scale_factor_); |
927 webview()->settings()->setAcceleratedCompositingForFixedPositionEnabled( | 941 webview()->settings()->setAcceleratedCompositingForFixedPositionEnabled( |
928 ShouldUseFixedPositionCompositing(device_scale_factor_)); | 942 ShouldUseFixedPositionCompositing(device_scale_factor_)); |
929 webview()->settings()->setAcceleratedCompositingForOverflowScrollEnabled( | 943 webview()->settings()->setAcceleratedCompositingForOverflowScrollEnabled( |
930 ShouldUseAcceleratedCompositingForOverflowScroll(device_scale_factor_)); | 944 ShouldUseAcceleratedCompositingForOverflowScroll(device_scale_factor_)); |
| 945 webview()->settings()->setCompositorDrivenAcceleratedScrollingEnabled( |
| 946 ShouldUseUniversalAcceleratedCompositingForOverflowScroll()); |
931 webview()->settings()->setAcceleratedCompositingForTransitionEnabled( | 947 webview()->settings()->setAcceleratedCompositingForTransitionEnabled( |
932 ShouldUseTransitionCompositing(device_scale_factor_)); | 948 ShouldUseTransitionCompositing(device_scale_factor_)); |
933 webview()->settings()->setAcceleratedCompositingForFixedRootBackgroundEnabled( | 949 webview()->settings()->setAcceleratedCompositingForFixedRootBackgroundEnabled( |
934 ShouldUseAcceleratedFixedRootBackground(device_scale_factor_)); | 950 ShouldUseAcceleratedFixedRootBackground(device_scale_factor_)); |
935 webview()->settings()->setAcceleratedCompositingForScrollableFramesEnabled( | 951 webview()->settings()->setAcceleratedCompositingForScrollableFramesEnabled( |
936 ShouldUseAcceleratedCompositingForScrollableFrames(device_scale_factor_)); | 952 ShouldUseAcceleratedCompositingForScrollableFrames(device_scale_factor_)); |
937 webview()->settings()->setCompositedScrollingForFramesEnabled( | 953 webview()->settings()->setCompositedScrollingForFramesEnabled( |
938 ShouldUseCompositedScrollingForFrames(device_scale_factor_)); | 954 ShouldUseCompositedScrollingForFrames(device_scale_factor_)); |
939 | 955 |
940 ApplyWebPreferences(webkit_preferences_, webview()); | 956 ApplyWebPreferences(webkit_preferences_, webview()); |
(...skipping 5660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6601 for (size_t i = 0; i < icon_urls.size(); i++) { | 6617 for (size_t i = 0; i < icon_urls.size(); i++) { |
6602 WebURL url = icon_urls[i].iconURL(); | 6618 WebURL url = icon_urls[i].iconURL(); |
6603 if (!url.isEmpty()) | 6619 if (!url.isEmpty()) |
6604 urls.push_back(FaviconURL(url, | 6620 urls.push_back(FaviconURL(url, |
6605 ToFaviconType(icon_urls[i].iconType()))); | 6621 ToFaviconType(icon_urls[i].iconType()))); |
6606 } | 6622 } |
6607 SendUpdateFaviconURL(urls); | 6623 SendUpdateFaviconURL(urls); |
6608 } | 6624 } |
6609 | 6625 |
6610 } // namespace content | 6626 } // namespace content |
OLD | NEW |