Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(741)

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 26809004: Add a flag for enabling/disabling the new accelerated scrolling path (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/public/common/content_switches.cc ('k') | webkit/common/webpreferences.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « content/public/common/content_switches.cc ('k') | webkit/common/webpreferences.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698