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

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

Issue 12544030: Chromium side plumbing for enabling fixed root background compositing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 6 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') | no next file » | 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 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 598
599 if (command_line.HasSwitch(switches::kDisableCompositingForTransition)) 599 if (command_line.HasSwitch(switches::kDisableCompositingForTransition))
600 return false; 600 return false;
601 601
602 if (command_line.HasSwitch(switches::kEnableCompositingForTransition)) 602 if (command_line.HasSwitch(switches::kEnableCompositingForTransition))
603 return true; 603 return true;
604 604
605 return DeviceScaleEnsuresTextQuality(device_scale_factor); 605 return DeviceScaleEnsuresTextQuality(device_scale_factor);
606 } 606 }
607 607
608 static bool ShouldUseAcceleratedFixedRootBackground(float device_scale_factor) {
609 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
610
611 if (command_line.HasSwitch(switches::kDisableAcceleratedFixedRootBackground))
612 return false;
613
614 if (command_line.HasSwitch(switches::kEnableAcceleratedFixedRootBackground))
615 return true;
616
617 return DeviceScaleEnsuresTextQuality(device_scale_factor);
618 }
619
608 static FaviconURL::IconType ToFaviconType(WebKit::WebIconURL::Type type) { 620 static FaviconURL::IconType ToFaviconType(WebKit::WebIconURL::Type type) {
609 switch (type) { 621 switch (type) {
610 case WebKit::WebIconURL::TypeFavicon: 622 case WebKit::WebIconURL::TypeFavicon:
611 return FaviconURL::FAVICON; 623 return FaviconURL::FAVICON;
612 case WebKit::WebIconURL::TypeTouch: 624 case WebKit::WebIconURL::TypeTouch:
613 return FaviconURL::TOUCH_ICON; 625 return FaviconURL::TOUCH_ICON;
614 case WebKit::WebIconURL::TypeTouchPrecomposed: 626 case WebKit::WebIconURL::TypeTouchPrecomposed:
615 return FaviconURL::TOUCH_PRECOMPOSED_ICON; 627 return FaviconURL::TOUCH_PRECOMPOSED_ICON;
616 case WebKit::WebIconURL::TypeInvalid: 628 case WebKit::WebIconURL::TypeInvalid:
617 return FaviconURL::INVALID_ICON; 629 return FaviconURL::INVALID_ICON;
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 CompleteInit(); 883 CompleteInit();
872 } 884 }
873 885
874 g_view_map.Get().insert(std::make_pair(webview(), this)); 886 g_view_map.Get().insert(std::make_pair(webview(), this));
875 g_routing_id_view_map.Get().insert(std::make_pair(routing_id_, this)); 887 g_routing_id_view_map.Get().insert(std::make_pair(routing_id_, this));
876 webview()->setDeviceScaleFactor(device_scale_factor_); 888 webview()->setDeviceScaleFactor(device_scale_factor_);
877 webview()->settings()->setAcceleratedCompositingForFixedPositionEnabled( 889 webview()->settings()->setAcceleratedCompositingForFixedPositionEnabled(
878 ShouldUseFixedPositionCompositing(device_scale_factor_)); 890 ShouldUseFixedPositionCompositing(device_scale_factor_));
879 webview()->settings()->setAcceleratedCompositingForTransitionEnabled( 891 webview()->settings()->setAcceleratedCompositingForTransitionEnabled(
880 ShouldUseTransitionCompositing(device_scale_factor_)); 892 ShouldUseTransitionCompositing(device_scale_factor_));
893 webview()->settings()->setAcceleratedCompositingForFixedRootBackgroundEnabled(
894 ShouldUseAcceleratedFixedRootBackground(device_scale_factor_));
881 895
882 webkit_glue::ApplyWebPreferences(webkit_preferences_, webview()); 896 webkit_glue::ApplyWebPreferences(webkit_preferences_, webview());
883 webview()->initializeMainFrame(this); 897 webview()->initializeMainFrame(this);
884 898
885 if (switches::IsTouchDragDropEnabled()) 899 if (switches::IsTouchDragDropEnabled())
886 webview()->settings()->setTouchDragDropEnabled(true); 900 webview()->settings()->setTouchDragDropEnabled(true);
887 901
888 if (switches::IsTouchEditingEnabled()) 902 if (switches::IsTouchEditingEnabled())
889 webview()->settings()->setTouchEditingEnabled(true); 903 webview()->settings()->setTouchEditingEnabled(true);
890 904
(...skipping 5299 matching lines...) Expand 10 before | Expand all | Expand 10 after
6190 } 6204 }
6191 6205
6192 void RenderViewImpl::SetDeviceScaleFactor(float device_scale_factor) { 6206 void RenderViewImpl::SetDeviceScaleFactor(float device_scale_factor) {
6193 RenderWidget::SetDeviceScaleFactor(device_scale_factor); 6207 RenderWidget::SetDeviceScaleFactor(device_scale_factor);
6194 if (webview()) { 6208 if (webview()) {
6195 webview()->setDeviceScaleFactor(device_scale_factor); 6209 webview()->setDeviceScaleFactor(device_scale_factor);
6196 webview()->settings()->setAcceleratedCompositingForFixedPositionEnabled( 6210 webview()->settings()->setAcceleratedCompositingForFixedPositionEnabled(
6197 ShouldUseFixedPositionCompositing(device_scale_factor_)); 6211 ShouldUseFixedPositionCompositing(device_scale_factor_));
6198 webview()->settings()->setAcceleratedCompositingForTransitionEnabled( 6212 webview()->settings()->setAcceleratedCompositingForTransitionEnabled(
6199 ShouldUseTransitionCompositing(device_scale_factor_)); 6213 ShouldUseTransitionCompositing(device_scale_factor_));
6214 webview()->settings()->
6215 setAcceleratedCompositingForFixedRootBackgroundEnabled(
6216 ShouldUseAcceleratedFixedRootBackground(device_scale_factor_));
6200 } 6217 }
6201 if (auto_resize_mode_) 6218 if (auto_resize_mode_)
6202 AutoResizeCompositor(); 6219 AutoResizeCompositor();
6203 6220
6204 if (browser_plugin_manager_.get()) 6221 if (browser_plugin_manager_.get())
6205 browser_plugin_manager_->UpdateDeviceScaleFactor(device_scale_factor_); 6222 browser_plugin_manager_->UpdateDeviceScaleFactor(device_scale_factor_);
6206 } 6223 }
6207 6224
6208 ui::TextInputType RenderViewImpl::GetTextInputType() { 6225 ui::TextInputType RenderViewImpl::GetTextInputType() {
6209 return pepper_helper_->IsPluginFocused() ? 6226 return pepper_helper_->IsPluginFocused() ?
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
6716 WebURL url = icon_urls[i].iconURL(); 6733 WebURL url = icon_urls[i].iconURL();
6717 if (!url.isEmpty()) 6734 if (!url.isEmpty())
6718 urls.push_back(FaviconURL(url, 6735 urls.push_back(FaviconURL(url,
6719 ToFaviconType(icon_urls[i].iconType()))); 6736 ToFaviconType(icon_urls[i].iconType())));
6720 } 6737 }
6721 SendUpdateFaviconURL(urls); 6738 SendUpdateFaviconURL(urls);
6722 } 6739 }
6723 6740
6724 6741
6725 } // namespace content 6742 } // namespace content
OLDNEW
« no previous file with comments | « content/public/common/content_switches.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698