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

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

Issue 314753002: Set up Finch experiment for expanded GPU rasterization trigger (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address asvitkine's comments Created 6 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 | « no previous file | 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"
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/bind_helpers.h" 12 #include "base/bind_helpers.h"
13 #include "base/command_line.h" 13 #include "base/command_line.h"
14 #include "base/compiler_specific.h" 14 #include "base/compiler_specific.h"
15 #include "base/debug/alias.h" 15 #include "base/debug/alias.h"
16 #include "base/debug/trace_event.h" 16 #include "base/debug/trace_event.h"
17 #include "base/files/file_path.h" 17 #include "base/files/file_path.h"
18 #include "base/i18n/rtl.h" 18 #include "base/i18n/rtl.h"
19 #include "base/json/json_writer.h" 19 #include "base/json/json_writer.h"
20 #include "base/lazy_instance.h" 20 #include "base/lazy_instance.h"
21 #include "base/memory/scoped_ptr.h" 21 #include "base/memory/scoped_ptr.h"
22 #include "base/message_loop/message_loop_proxy.h" 22 #include "base/message_loop/message_loop_proxy.h"
23 #include "base/metrics/field_trial.h"
23 #include "base/metrics/histogram.h" 24 #include "base/metrics/histogram.h"
24 #include "base/path_service.h" 25 #include "base/path_service.h"
25 #include "base/process/kill.h" 26 #include "base/process/kill.h"
26 #include "base/process/process.h" 27 #include "base/process/process.h"
27 #include "base/strings/string_number_conversions.h" 28 #include "base/strings/string_number_conversions.h"
28 #include "base/strings/string_piece.h" 29 #include "base/strings/string_piece.h"
29 #include "base/strings/string_split.h" 30 #include "base/strings/string_split.h"
30 #include "base/strings/string_util.h" 31 #include "base/strings/string_util.h"
31 #include "base/strings/sys_string_conversions.h" 32 #include "base/strings/sys_string_conversions.h"
32 #include "base/strings/utf_string_conversions.h" 33 #include "base/strings/utf_string_conversions.h"
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 466
466 if (command_line.HasSwitch(switches::kDisableAcceleratedFixedRootBackground)) 467 if (command_line.HasSwitch(switches::kDisableAcceleratedFixedRootBackground))
467 return false; 468 return false;
468 469
469 if (command_line.HasSwitch(switches::kEnableAcceleratedFixedRootBackground)) 470 if (command_line.HasSwitch(switches::kEnableAcceleratedFixedRootBackground))
470 return true; 471 return true;
471 472
472 return DeviceScaleEnsuresTextQuality(device_scale_factor); 473 return DeviceScaleEnsuresTextQuality(device_scale_factor);
473 } 474 }
474 475
476 static bool ShouldUseExpandedHeuristicsForGpuRasterization() {
477 return base::FieldTrialList::FindFullName(
478 "GpuRasterizationExpandedContentWhitelist") == "Enabled";
479 }
480
475 static FaviconURL::IconType ToFaviconType(blink::WebIconURL::Type type) { 481 static FaviconURL::IconType ToFaviconType(blink::WebIconURL::Type type) {
476 switch (type) { 482 switch (type) {
477 case blink::WebIconURL::TypeFavicon: 483 case blink::WebIconURL::TypeFavicon:
478 return FaviconURL::FAVICON; 484 return FaviconURL::FAVICON;
479 case blink::WebIconURL::TypeTouch: 485 case blink::WebIconURL::TypeTouch:
480 return FaviconURL::TOUCH_ICON; 486 return FaviconURL::TOUCH_ICON;
481 case blink::WebIconURL::TypeTouchPrecomposed: 487 case blink::WebIconURL::TypeTouchPrecomposed:
482 return FaviconURL::TOUCH_PRECOMPOSED_ICON; 488 return FaviconURL::TOUCH_PRECOMPOSED_ICON;
483 case blink::WebIconURL::TypeInvalid: 489 case blink::WebIconURL::TypeInvalid:
484 return FaviconURL::INVALID_ICON; 490 return FaviconURL::INVALID_ICON;
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 webview()->settings()->setAcceleratedCompositingForOverflowScrollEnabled( 750 webview()->settings()->setAcceleratedCompositingForOverflowScrollEnabled(
745 ShouldUseAcceleratedCompositingForOverflowScroll(device_scale_factor_)); 751 ShouldUseAcceleratedCompositingForOverflowScroll(device_scale_factor_));
746 webview()->settings()->setCompositorDrivenAcceleratedScrollingEnabled( 752 webview()->settings()->setCompositorDrivenAcceleratedScrollingEnabled(
747 ShouldUseUniversalAcceleratedCompositingForOverflowScroll()); 753 ShouldUseUniversalAcceleratedCompositingForOverflowScroll());
748 webview()->settings()->setAcceleratedCompositingForTransitionEnabled( 754 webview()->settings()->setAcceleratedCompositingForTransitionEnabled(
749 ShouldUseTransitionCompositing(device_scale_factor_)); 755 ShouldUseTransitionCompositing(device_scale_factor_));
750 webview()->settings()->setAcceleratedCompositingForFixedRootBackgroundEnabled( 756 webview()->settings()->setAcceleratedCompositingForFixedRootBackgroundEnabled(
751 ShouldUseAcceleratedFixedRootBackground(device_scale_factor_)); 757 ShouldUseAcceleratedFixedRootBackground(device_scale_factor_));
752 webview()->settings()->setCompositedScrollingForFramesEnabled( 758 webview()->settings()->setCompositedScrollingForFramesEnabled(
753 ShouldUseCompositedScrollingForFrames(device_scale_factor_)); 759 ShouldUseCompositedScrollingForFrames(device_scale_factor_));
760 webview()->settings()->setUseExpandedHeuristicsForGpuRasterization(
761 ShouldUseExpandedHeuristicsForGpuRasterization());
754 762
755 ApplyWebPreferences(webkit_preferences_, webview()); 763 ApplyWebPreferences(webkit_preferences_, webview());
756 764
757 webview()->settings()->setAllowConnectingInsecureWebSocket( 765 webview()->settings()->setAllowConnectingInsecureWebSocket(
758 command_line.HasSwitch(switches::kAllowInsecureWebSocketFromHttpsOrigin)); 766 command_line.HasSwitch(switches::kAllowInsecureWebSocketFromHttpsOrigin));
759 767
760 main_render_frame_.reset(main_render_frame); 768 main_render_frame_.reset(main_render_frame);
761 webview()->setMainFrame(main_render_frame_->GetWebFrame()); 769 webview()->setMainFrame(main_render_frame_->GetWebFrame());
762 main_render_frame_->Initialize(); 770 main_render_frame_->Initialize();
763 771
(...skipping 3287 matching lines...) Expand 10 before | Expand all | Expand 10 after
4051 std::vector<gfx::Size> sizes; 4059 std::vector<gfx::Size> sizes;
4052 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); 4060 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes);
4053 if (!url.isEmpty()) 4061 if (!url.isEmpty())
4054 urls.push_back( 4062 urls.push_back(
4055 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); 4063 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes));
4056 } 4064 }
4057 SendUpdateFaviconURL(urls); 4065 SendUpdateFaviconURL(urls);
4058 } 4066 }
4059 4067
4060 } // namespace content 4068 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698