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

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

Issue 27393002: Revert "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 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 599
600 if (command_line.HasSwitch(switches::kDisableAcceleratedOverflowScroll)) 600 if (command_line.HasSwitch(switches::kDisableAcceleratedOverflowScroll))
601 return false; 601 return false;
602 602
603 if (command_line.HasSwitch(switches::kEnableAcceleratedOverflowScroll)) 603 if (command_line.HasSwitch(switches::kEnableAcceleratedOverflowScroll))
604 return true; 604 return true;
605 605
606 return DeviceScaleEnsuresTextQuality(device_scale_factor); 606 return DeviceScaleEnsuresTextQuality(device_scale_factor);
607 } 607 }
608 608
609 static bool ShouldUseUniversalAcceleratedCompositingForOverflowScroll() {
610 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
611
612 if (command_line.HasSwitch(
613 switches::kDisableUniversalAcceleratedOverflowScroll))
614 return false;
615
616 if (command_line.HasSwitch(
617 switches::kEnableUniversalAcceleratedOverflowScroll))
618 return true;
619
620 return false;
621 }
622
623 static bool ShouldUseTransitionCompositing(float device_scale_factor) { 609 static bool ShouldUseTransitionCompositing(float device_scale_factor) {
624 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 610 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
625 611
626 if (command_line.HasSwitch(switches::kDisableCompositingForTransition)) 612 if (command_line.HasSwitch(switches::kDisableCompositingForTransition))
627 return false; 613 return false;
628 614
629 if (command_line.HasSwitch(switches::kEnableCompositingForTransition)) 615 if (command_line.HasSwitch(switches::kEnableCompositingForTransition))
630 return true; 616 return true;
631 617
632 // TODO(ajuma): Re-enable this by default for high-DPI once the problem 618 // 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
902 CompleteInit(); 888 CompleteInit();
903 } 889 }
904 890
905 g_view_map.Get().insert(std::make_pair(webview(), this)); 891 g_view_map.Get().insert(std::make_pair(webview(), this));
906 g_routing_id_view_map.Get().insert(std::make_pair(routing_id_, this)); 892 g_routing_id_view_map.Get().insert(std::make_pair(routing_id_, this));
907 webview()->setDeviceScaleFactor(device_scale_factor_); 893 webview()->setDeviceScaleFactor(device_scale_factor_);
908 webview()->settings()->setAcceleratedCompositingForFixedPositionEnabled( 894 webview()->settings()->setAcceleratedCompositingForFixedPositionEnabled(
909 ShouldUseFixedPositionCompositing(device_scale_factor_)); 895 ShouldUseFixedPositionCompositing(device_scale_factor_));
910 webview()->settings()->setAcceleratedCompositingForOverflowScrollEnabled( 896 webview()->settings()->setAcceleratedCompositingForOverflowScrollEnabled(
911 ShouldUseAcceleratedCompositingForOverflowScroll(device_scale_factor_)); 897 ShouldUseAcceleratedCompositingForOverflowScroll(device_scale_factor_));
912 webview()->settings()->setCompositorDrivenAcceleratedScrollingEnabled(
913 ShouldUseUniversalAcceleratedCompositingForOverflowScroll());
914 webview()->settings()->setAcceleratedCompositingForTransitionEnabled( 898 webview()->settings()->setAcceleratedCompositingForTransitionEnabled(
915 ShouldUseTransitionCompositing(device_scale_factor_)); 899 ShouldUseTransitionCompositing(device_scale_factor_));
916 webview()->settings()->setAcceleratedCompositingForFixedRootBackgroundEnabled( 900 webview()->settings()->setAcceleratedCompositingForFixedRootBackgroundEnabled(
917 ShouldUseAcceleratedFixedRootBackground(device_scale_factor_)); 901 ShouldUseAcceleratedFixedRootBackground(device_scale_factor_));
918 902
919 ApplyWebPreferences(webkit_preferences_, webview()); 903 ApplyWebPreferences(webkit_preferences_, webview());
920 904
921 main_render_frame_.reset( 905 main_render_frame_.reset(
922 RenderFrameImpl::Create(this, params->main_frame_routing_id)); 906 RenderFrameImpl::Create(this, params->main_frame_routing_id));
923 // The main frame WebFrame object is closed by 907 // The main frame WebFrame object is closed by
(...skipping 5651 matching lines...) Expand 10 before | Expand all | Expand 10 after
6575 for (size_t i = 0; i < icon_urls.size(); i++) { 6559 for (size_t i = 0; i < icon_urls.size(); i++) {
6576 WebURL url = icon_urls[i].iconURL(); 6560 WebURL url = icon_urls[i].iconURL();
6577 if (!url.isEmpty()) 6561 if (!url.isEmpty())
6578 urls.push_back(FaviconURL(url, 6562 urls.push_back(FaviconURL(url,
6579 ToFaviconType(icon_urls[i].iconType()))); 6563 ToFaviconType(icon_urls[i].iconType())));
6580 } 6564 }
6581 SendUpdateFaviconURL(urls); 6565 SendUpdateFaviconURL(urls);
6582 } 6566 }
6583 6567
6584 } // namespace content 6568 } // 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