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() { | |
| 606 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | |
| 607 | |
| 608 if (command_line.HasSwitch( | |
| 609 switches::kDisableUniversalAcceleratedOverflowScroll)) | |
|
shawnsingh
2013/10/11 01:34:50
wait!!!!
This code would compile, but seems prett
Ian Vollick
2013/10/11 01:38:59
Whoa. Don't know how I missed this. Thanks for cat
| |
| 610 | |
| 611 if (command_line.HasSwitch( | |
| 612 switches::kEnableUniversalAcceleratedOverflowScroll)) | |
| 613 return true; | |
| 614 | |
| 615 return false; | |
| 616 } | |
| 617 | |
| 605 static bool ShouldUseAcceleratedCompositingForScrollableFrames( | 618 static bool ShouldUseAcceleratedCompositingForScrollableFrames( |
| 606 float device_scale_factor) { | 619 float device_scale_factor) { |
| 607 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 620 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 608 | 621 |
| 609 if (command_line.HasSwitch(switches::kDisableAcceleratedScrollableFrames)) | 622 if (command_line.HasSwitch(switches::kDisableAcceleratedScrollableFrames)) |
| 610 return false; | 623 return false; |
| 611 | 624 |
| 612 if (command_line.HasSwitch(switches::kEnableAcceleratedScrollableFrames)) | 625 if (command_line.HasSwitch(switches::kEnableAcceleratedScrollableFrames)) |
| 613 return true; | 626 return true; |
| 614 | 627 |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 916 CompleteInit(); | 929 CompleteInit(); |
| 917 } | 930 } |
| 918 | 931 |
| 919 g_view_map.Get().insert(std::make_pair(webview(), this)); | 932 g_view_map.Get().insert(std::make_pair(webview(), this)); |
| 920 g_routing_id_view_map.Get().insert(std::make_pair(routing_id_, this)); | 933 g_routing_id_view_map.Get().insert(std::make_pair(routing_id_, this)); |
| 921 webview()->setDeviceScaleFactor(device_scale_factor_); | 934 webview()->setDeviceScaleFactor(device_scale_factor_); |
| 922 webview()->settings()->setAcceleratedCompositingForFixedPositionEnabled( | 935 webview()->settings()->setAcceleratedCompositingForFixedPositionEnabled( |
| 923 ShouldUseFixedPositionCompositing(device_scale_factor_)); | 936 ShouldUseFixedPositionCompositing(device_scale_factor_)); |
| 924 webview()->settings()->setAcceleratedCompositingForOverflowScrollEnabled( | 937 webview()->settings()->setAcceleratedCompositingForOverflowScrollEnabled( |
| 925 ShouldUseAcceleratedCompositingForOverflowScroll(device_scale_factor_)); | 938 ShouldUseAcceleratedCompositingForOverflowScroll(device_scale_factor_)); |
| 939 webview()->settings()->setCompositorDrivenAcceleratedScrollingEnabled( | |
| 940 ShouldUseUniversalAcceleratedCompositingForOverflowScroll()); | |
| 926 webview()->settings()->setAcceleratedCompositingForTransitionEnabled( | 941 webview()->settings()->setAcceleratedCompositingForTransitionEnabled( |
| 927 ShouldUseTransitionCompositing(device_scale_factor_)); | 942 ShouldUseTransitionCompositing(device_scale_factor_)); |
| 928 webview()->settings()->setAcceleratedCompositingForFixedRootBackgroundEnabled( | 943 webview()->settings()->setAcceleratedCompositingForFixedRootBackgroundEnabled( |
| 929 ShouldUseAcceleratedFixedRootBackground(device_scale_factor_)); | 944 ShouldUseAcceleratedFixedRootBackground(device_scale_factor_)); |
| 930 webview()->settings()->setAcceleratedCompositingForScrollableFramesEnabled( | 945 webview()->settings()->setAcceleratedCompositingForScrollableFramesEnabled( |
| 931 ShouldUseAcceleratedCompositingForScrollableFrames(device_scale_factor_)); | 946 ShouldUseAcceleratedCompositingForScrollableFrames(device_scale_factor_)); |
| 932 webview()->settings()->setCompositedScrollingForFramesEnabled( | 947 webview()->settings()->setCompositedScrollingForFramesEnabled( |
| 933 ShouldUseCompositedScrollingForFrames(device_scale_factor_)); | 948 ShouldUseCompositedScrollingForFrames(device_scale_factor_)); |
| 934 | 949 |
| 935 ApplyWebPreferences(webkit_preferences_, webview()); | 950 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++) { | 6588 for (size_t i = 0; i < icon_urls.size(); i++) { |
| 6574 WebURL url = icon_urls[i].iconURL(); | 6589 WebURL url = icon_urls[i].iconURL(); |
| 6575 if (!url.isEmpty()) | 6590 if (!url.isEmpty()) |
| 6576 urls.push_back(FaviconURL(url, | 6591 urls.push_back(FaviconURL(url, |
| 6577 ToFaviconType(icon_urls[i].iconType()))); | 6592 ToFaviconType(icon_urls[i].iconType()))); |
| 6578 } | 6593 } |
| 6579 SendUpdateFaviconURL(urls); | 6594 SendUpdateFaviconURL(urls); |
| 6580 } | 6595 } |
| 6581 | 6596 |
| 6582 } // namespace content | 6597 } // namespace content |
| OLD | NEW |