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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 if (command_line.HasSwitch(switches::kDisablePreferCompositingToLCDText)) | 404 if (command_line.HasSwitch(switches::kDisablePreferCompositingToLCDText)) |
405 return false; | 405 return false; |
406 if (command_line.HasSwitch(switches::kEnablePreferCompositingToLCDText)) | 406 if (command_line.HasSwitch(switches::kEnablePreferCompositingToLCDText)) |
407 return true; | 407 return true; |
408 if (RenderThreadImpl::current() && | 408 if (RenderThreadImpl::current() && |
409 !RenderThreadImpl::current()->is_lcd_text_enabled()) | 409 !RenderThreadImpl::current()->is_lcd_text_enabled()) |
410 return true; | 410 return true; |
411 return DeviceScaleEnsuresTextQuality(device_scale_factor); | 411 return DeviceScaleEnsuresTextQuality(device_scale_factor); |
412 } | 412 } |
413 | 413 |
414 static bool ShouldUseCompositedScrollingForFrames( | |
415 float device_scale_factor) { | |
416 if (RenderThreadImpl::current() && | |
417 !RenderThreadImpl::current()->is_lcd_text_enabled()) | |
418 return true; | |
419 | |
420 return DeviceScaleEnsuresTextQuality(device_scale_factor); | |
421 } | |
422 | |
423 static bool ShouldUseTransitionCompositing(float device_scale_factor) { | 414 static bool ShouldUseTransitionCompositing(float device_scale_factor) { |
424 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 415 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
425 | 416 |
426 if (command_line.HasSwitch(switches::kDisableCompositingForTransition)) | 417 if (command_line.HasSwitch(switches::kDisableCompositingForTransition)) |
427 return false; | 418 return false; |
428 | 419 |
429 if (command_line.HasSwitch(switches::kEnableCompositingForTransition)) | 420 if (command_line.HasSwitch(switches::kEnableCompositingForTransition)) |
430 return true; | 421 return true; |
431 | 422 |
432 // TODO(ajuma): Re-enable this by default for high-DPI once the problem | 423 // TODO(ajuma): Re-enable this by default for high-DPI once the problem |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
771 webview()->setDeviceScaleFactor(device_scale_factor_); | 762 webview()->setDeviceScaleFactor(device_scale_factor_); |
772 webview()->settings()->setPreferCompositingToLCDTextEnabled( | 763 webview()->settings()->setPreferCompositingToLCDTextEnabled( |
773 PreferCompositingToLCDText(device_scale_factor_)); | 764 PreferCompositingToLCDText(device_scale_factor_)); |
774 webview()->settings()->setAcceleratedCompositingForOverflowScrollEnabled( | 765 webview()->settings()->setAcceleratedCompositingForOverflowScrollEnabled( |
775 PreferCompositingToLCDText(device_scale_factor_)); | 766 PreferCompositingToLCDText(device_scale_factor_)); |
776 webview()->settings()->setAcceleratedCompositingForTransitionEnabled( | 767 webview()->settings()->setAcceleratedCompositingForTransitionEnabled( |
777 ShouldUseTransitionCompositing(device_scale_factor_)); | 768 ShouldUseTransitionCompositing(device_scale_factor_)); |
778 webview()->settings()->setAcceleratedCompositingForFixedRootBackgroundEnabled( | 769 webview()->settings()->setAcceleratedCompositingForFixedRootBackgroundEnabled( |
779 PreferCompositingToLCDText(device_scale_factor_)); | 770 PreferCompositingToLCDText(device_scale_factor_)); |
780 webview()->settings()->setCompositedScrollingForFramesEnabled( | 771 webview()->settings()->setCompositedScrollingForFramesEnabled( |
781 ShouldUseCompositedScrollingForFrames(device_scale_factor_)); | 772 PreferCompositingToLCDText(device_scale_factor_)); |
782 | 773 |
783 ApplyWebPreferences(webkit_preferences_, webview()); | 774 ApplyWebPreferences(webkit_preferences_, webview()); |
784 | 775 |
785 webview()->settings()->setAllowConnectingInsecureWebSocket( | 776 webview()->settings()->setAllowConnectingInsecureWebSocket( |
786 command_line.HasSwitch(switches::kAllowInsecureWebSocketFromHttpsOrigin)); | 777 command_line.HasSwitch(switches::kAllowInsecureWebSocketFromHttpsOrigin)); |
787 | 778 |
788 RenderFrameProxy* proxy = NULL; | 779 RenderFrameProxy* proxy = NULL; |
789 if (params->proxy_routing_id != MSG_ROUTING_NONE) { | 780 if (params->proxy_routing_id != MSG_ROUTING_NONE) { |
790 CHECK(params->swapped_out); | 781 CHECK(params->swapped_out); |
791 proxy = RenderFrameProxy::CreateProxyToReplaceFrame( | 782 proxy = RenderFrameProxy::CreateProxyToReplaceFrame( |
(...skipping 2953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3745 PreferCompositingToLCDText(device_scale_factor_)); | 3736 PreferCompositingToLCDText(device_scale_factor_)); |
3746 webview()->settings()->setAcceleratedCompositingForOverflowScrollEnabled( | 3737 webview()->settings()->setAcceleratedCompositingForOverflowScrollEnabled( |
3747 PreferCompositingToLCDText(device_scale_factor_)); | 3738 PreferCompositingToLCDText(device_scale_factor_)); |
3748 webview()->settings()->setAcceleratedCompositingForTransitionEnabled( | 3739 webview()->settings()->setAcceleratedCompositingForTransitionEnabled( |
3749 ShouldUseTransitionCompositing(device_scale_factor_)); | 3740 ShouldUseTransitionCompositing(device_scale_factor_)); |
3750 webview() | 3741 webview() |
3751 ->settings() | 3742 ->settings() |
3752 ->setAcceleratedCompositingForFixedRootBackgroundEnabled( | 3743 ->setAcceleratedCompositingForFixedRootBackgroundEnabled( |
3753 PreferCompositingToLCDText(device_scale_factor_)); | 3744 PreferCompositingToLCDText(device_scale_factor_)); |
3754 webview()->settings()->setCompositedScrollingForFramesEnabled( | 3745 webview()->settings()->setCompositedScrollingForFramesEnabled( |
3755 ShouldUseCompositedScrollingForFrames(device_scale_factor_)); | 3746 PreferCompositingToLCDText(device_scale_factor_)); |
3756 } | 3747 } |
3757 if (auto_resize_mode_) | 3748 if (auto_resize_mode_) |
3758 AutoResizeCompositor(); | 3749 AutoResizeCompositor(); |
3759 | 3750 |
3760 if (browser_plugin_manager_.get()) | 3751 if (browser_plugin_manager_.get()) |
3761 browser_plugin_manager_->UpdateDeviceScaleFactor(device_scale_factor_); | 3752 browser_plugin_manager_->UpdateDeviceScaleFactor(device_scale_factor_); |
3762 } | 3753 } |
3763 | 3754 |
3764 bool RenderViewImpl::SetDeviceColorProfile( | 3755 bool RenderViewImpl::SetDeviceColorProfile( |
3765 const std::vector<char>& profile) { | 3756 const std::vector<char>& profile) { |
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4311 std::vector<gfx::Size> sizes; | 4302 std::vector<gfx::Size> sizes; |
4312 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4303 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
4313 if (!url.isEmpty()) | 4304 if (!url.isEmpty()) |
4314 urls.push_back( | 4305 urls.push_back( |
4315 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4306 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
4316 } | 4307 } |
4317 SendUpdateFaviconURL(urls); | 4308 SendUpdateFaviconURL(urls); |
4318 } | 4309 } |
4319 | 4310 |
4320 } // namespace content | 4311 } // namespace content |
OLD | NEW |