Chromium Code Reviews| 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 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 595 static bool ShouldUseAcceleratedCompositingForOverflowScroll( | 595 static bool ShouldUseAcceleratedCompositingForOverflowScroll( |
| 596 float device_scale_factor) { | 596 float device_scale_factor) { |
| 597 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 597 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 598 | 598 |
| 599 if (command_line.HasSwitch(switches::kEnableAcceleratedOverflowScroll)) | 599 if (command_line.HasSwitch(switches::kEnableAcceleratedOverflowScroll)) |
| 600 return true; | 600 return true; |
| 601 | 601 |
| 602 return DeviceScaleEnsuresTextQuality(device_scale_factor); | 602 return DeviceScaleEnsuresTextQuality(device_scale_factor); |
| 603 } | 603 } |
| 604 | 604 |
| 605 static bool ShouldUseUniversalAcceleratedCompositingForOverflowScroll() { | |
|
darin (slow to review)
2013/10/11 04:58:13
Impressive function name!
| |
| 606 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | |
| 607 | |
| 608 if (command_line.HasSwitch( | |
| 609 switches::kDisableUniversalAcceleratedOverflowScroll)) | |
| 610 return false; | |
| 611 | |
| 612 if (command_line.HasSwitch( | |
| 613 switches::kEnableUniversalAcceleratedOverflowScroll)) | |
| 614 return true; | |
| 615 | |
| 616 return false; | |
| 617 } | |
| 618 | |
| 605 static bool ShouldUseAcceleratedCompositingForScrollableFrames( | 619 static bool ShouldUseAcceleratedCompositingForScrollableFrames( |
| 606 float device_scale_factor) { | 620 float device_scale_factor) { |
| 607 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 621 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 608 | 622 |
| 609 if (command_line.HasSwitch(switches::kDisableAcceleratedScrollableFrames)) | 623 if (command_line.HasSwitch(switches::kDisableAcceleratedScrollableFrames)) |
| 610 return false; | 624 return false; |
| 611 | 625 |
| 612 if (command_line.HasSwitch(switches::kEnableAcceleratedScrollableFrames)) | 626 if (command_line.HasSwitch(switches::kEnableAcceleratedScrollableFrames)) |
| 613 return true; | 627 return true; |
| 614 | 628 |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 916 CompleteInit(); | 930 CompleteInit(); |
| 917 } | 931 } |
| 918 | 932 |
| 919 g_view_map.Get().insert(std::make_pair(webview(), this)); | 933 g_view_map.Get().insert(std::make_pair(webview(), this)); |
| 920 g_routing_id_view_map.Get().insert(std::make_pair(routing_id_, this)); | 934 g_routing_id_view_map.Get().insert(std::make_pair(routing_id_, this)); |
| 921 webview()->setDeviceScaleFactor(device_scale_factor_); | 935 webview()->setDeviceScaleFactor(device_scale_factor_); |
| 922 webview()->settings()->setAcceleratedCompositingForFixedPositionEnabled( | 936 webview()->settings()->setAcceleratedCompositingForFixedPositionEnabled( |
| 923 ShouldUseFixedPositionCompositing(device_scale_factor_)); | 937 ShouldUseFixedPositionCompositing(device_scale_factor_)); |
| 924 webview()->settings()->setAcceleratedCompositingForOverflowScrollEnabled( | 938 webview()->settings()->setAcceleratedCompositingForOverflowScrollEnabled( |
| 925 ShouldUseAcceleratedCompositingForOverflowScroll(device_scale_factor_)); | 939 ShouldUseAcceleratedCompositingForOverflowScroll(device_scale_factor_)); |
| 940 webview()->settings()->setCompositorDrivenAcceleratedScrollingEnabled( | |
| 941 ShouldUseUniversalAcceleratedCompositingForOverflowScroll()); | |
| 926 webview()->settings()->setAcceleratedCompositingForTransitionEnabled( | 942 webview()->settings()->setAcceleratedCompositingForTransitionEnabled( |
| 927 ShouldUseTransitionCompositing(device_scale_factor_)); | 943 ShouldUseTransitionCompositing(device_scale_factor_)); |
| 928 webview()->settings()->setAcceleratedCompositingForFixedRootBackgroundEnabled( | 944 webview()->settings()->setAcceleratedCompositingForFixedRootBackgroundEnabled( |
| 929 ShouldUseAcceleratedFixedRootBackground(device_scale_factor_)); | 945 ShouldUseAcceleratedFixedRootBackground(device_scale_factor_)); |
| 930 webview()->settings()->setAcceleratedCompositingForScrollableFramesEnabled( | 946 webview()->settings()->setAcceleratedCompositingForScrollableFramesEnabled( |
| 931 ShouldUseAcceleratedCompositingForScrollableFrames(device_scale_factor_)); | 947 ShouldUseAcceleratedCompositingForScrollableFrames(device_scale_factor_)); |
| 932 webview()->settings()->setCompositedScrollingForFramesEnabled( | 948 webview()->settings()->setCompositedScrollingForFramesEnabled( |
| 933 ShouldUseCompositedScrollingForFrames(device_scale_factor_)); | 949 ShouldUseCompositedScrollingForFrames(device_scale_factor_)); |
| 934 | 950 |
| 935 ApplyWebPreferences(webkit_preferences_, webview()); | 951 ApplyWebPreferences(webkit_preferences_, webview()); |
| (...skipping 5637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6573 for (size_t i = 0; i < icon_urls.size(); i++) { | 6589 for (size_t i = 0; i < icon_urls.size(); i++) { |
| 6574 WebURL url = icon_urls[i].iconURL(); | 6590 WebURL url = icon_urls[i].iconURL(); |
| 6575 if (!url.isEmpty()) | 6591 if (!url.isEmpty()) |
| 6576 urls.push_back(FaviconURL(url, | 6592 urls.push_back(FaviconURL(url, |
| 6577 ToFaviconType(icon_urls[i].iconType()))); | 6593 ToFaviconType(icon_urls[i].iconType()))); |
| 6578 } | 6594 } |
| 6579 SendUpdateFaviconURL(urls); | 6595 SendUpdateFaviconURL(urls); |
| 6580 } | 6596 } |
| 6581 | 6597 |
| 6582 } // namespace content | 6598 } // namespace content |
| OLD | NEW |