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

Side by Side Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 189883009: Define a --force-gpu-rasterization flag (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Minor logic fix-up Created 6 years, 9 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
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 // Represents the browser side of the browser <--> renderer communication 5 // Represents the browser side of the browser <--> renderer communication
6 // channel. There will be one RenderProcessHost per renderer process. 6 // channel. There will be one RenderProcessHost per renderer process.
7 7
8 #include "content/browser/renderer_host/render_process_host_impl.h" 8 #include "content/browser/renderer_host/render_process_host_impl.h"
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after
906 return storage_partition_impl_; 906 return storage_partition_impl_;
907 } 907 }
908 908
909 static void AppendGpuCommandLineFlags(CommandLine* command_line) { 909 static void AppendGpuCommandLineFlags(CommandLine* command_line) {
910 if (content::IsThreadedCompositingEnabled()) 910 if (content::IsThreadedCompositingEnabled())
911 command_line->AppendSwitch(switches::kEnableThreadedCompositing); 911 command_line->AppendSwitch(switches::kEnableThreadedCompositing);
912 912
913 if (content::IsDelegatedRendererEnabled()) 913 if (content::IsDelegatedRendererEnabled())
914 command_line->AppendSwitch(switches::kEnableDelegatedRenderer); 914 command_line->AppendSwitch(switches::kEnableDelegatedRenderer);
915 915
916 if (content::IsImplSidePaintingEnabled())
917 command_line->AppendSwitch(switches::kEnableImplSidePainting);
918
916 // Appending disable-gpu-feature switches due to software rendering list. 919 // Appending disable-gpu-feature switches due to software rendering list.
917 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); 920 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance();
918 DCHECK(gpu_data_manager); 921 DCHECK(gpu_data_manager);
919 gpu_data_manager->AppendRendererCommandLine(command_line); 922 gpu_data_manager->AppendRendererCommandLine(command_line);
920 } 923 }
921 924
922 void RenderProcessHostImpl::AppendRendererCommandLine( 925 void RenderProcessHostImpl::AppendRendererCommandLine(
923 CommandLine* command_line) const { 926 CommandLine* command_line) const {
924 // Pass the process type first, so it shows first in process listings. 927 // Pass the process type first, so it shows first in process listings.
925 command_line->AppendSwitchASCII(switches::kProcessType, 928 command_line->AppendSwitchASCII(switches::kProcessType,
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
978 switches::kDisableCompositingForFixedPosition, 981 switches::kDisableCompositingForFixedPosition,
979 switches::kDisableCompositingForTransition, 982 switches::kDisableCompositingForTransition,
980 switches::kDisableDatabases, 983 switches::kDisableDatabases,
981 switches::kDisableDelegatedRenderer, 984 switches::kDisableDelegatedRenderer,
982 switches::kDisableDesktopNotifications, 985 switches::kDisableDesktopNotifications,
983 switches::kDisableDirectNPAPIRequests, 986 switches::kDisableDirectNPAPIRequests,
984 switches::kDisableFileSystem, 987 switches::kDisableFileSystem,
985 switches::kDisableFiltersOverIPC, 988 switches::kDisableFiltersOverIPC,
986 switches::kDisableGpu, 989 switches::kDisableGpu,
987 switches::kDisableGpuCompositing, 990 switches::kDisableGpuCompositing,
991 switches::kDisableGpuRasterization,
988 switches::kDisableGpuVsync, 992 switches::kDisableGpuVsync,
989 switches::kDisableHistogramCustomizer, 993 switches::kDisableHistogramCustomizer,
994 switches::kDisableImplSidePainting,
995 switches::kDisableLCDText,
990 switches::kDisableLayerSquashing, 996 switches::kDisableLayerSquashing,
991 switches::kDisableLocalStorage, 997 switches::kDisableLocalStorage,
992 switches::kDisableLogging, 998 switches::kDisableLogging,
999 switches::kDisableMapImage,
993 switches::kDisableOverlayScrollbar, 1000 switches::kDisableOverlayScrollbar,
994 switches::kDisablePinch, 1001 switches::kDisablePinch,
995 switches::kDisablePrefixedEncryptedMedia, 1002 switches::kDisablePrefixedEncryptedMedia,
996 switches::kDisableRepaintAfterLayout, 1003 switches::kDisableRepaintAfterLayout,
997 switches::kDisableSeccompFilterSandbox, 1004 switches::kDisableSeccompFilterSandbox,
998 switches::kDisableSessionStorage, 1005 switches::kDisableSessionStorage,
999 switches::kDisableSharedWorkers, 1006 switches::kDisableSharedWorkers,
1000 switches::kDisableSpeechInput, 1007 switches::kDisableSpeechInput,
1001 switches::kDisableThreadedCompositing, 1008 switches::kDisableThreadedCompositing,
1002 switches::kDisableTouchAdjustment, 1009 switches::kDisableTouchAdjustment,
(...skipping 17 matching lines...) Expand all
1020 switches::kEnableDCHECK, 1027 switches::kEnableDCHECK,
1021 switches::kEnableDeferredImageDecoding, 1028 switches::kEnableDeferredImageDecoding,
1022 switches::kEnableDelegatedRenderer, 1029 switches::kEnableDelegatedRenderer,
1023 switches::kEnableEncryptedMedia, 1030 switches::kEnableEncryptedMedia,
1024 switches::kEnableExperimentalCanvasFeatures, 1031 switches::kEnableExperimentalCanvasFeatures,
1025 switches::kEnableExperimentalWebPlatformFeatures, 1032 switches::kEnableExperimentalWebPlatformFeatures,
1026 switches::kEnableExperimentalWebSocket, 1033 switches::kEnableExperimentalWebSocket,
1027 switches::kEnableFastTextAutosizing, 1034 switches::kEnableFastTextAutosizing,
1028 switches::kEnableGPUClientLogging, 1035 switches::kEnableGPUClientLogging,
1029 switches::kEnableGpuClientTracing, 1036 switches::kEnableGpuClientTracing,
1037 switches::kEnableGpuRasterization,
1030 switches::kEnableGPUServiceLogging, 1038 switches::kEnableGPUServiceLogging,
1031 switches::kEnableHighDpiCompositingForFixedPosition, 1039 switches::kEnableHighDpiCompositingForFixedPosition,
1032 switches::kEnableHTMLImports, 1040 switches::kEnableHTMLImports,
1041 switches::kEnableImplSidePainting,
1033 switches::kEnableInbandTextTracks, 1042 switches::kEnableInbandTextTracks,
1043 switches::kEnableLCDText,
1034 switches::kEnableLayerSquashing, 1044 switches::kEnableLayerSquashing,
1035 switches::kEnableLogging, 1045 switches::kEnableLogging,
1036 switches::kEnableMP3StreamParser, 1046 switches::kEnableMP3StreamParser,
1047 switches::kEnableMapImage,
1037 switches::kEnableMemoryBenchmarking, 1048 switches::kEnableMemoryBenchmarking,
1038 switches::kEnableOverlayFullscreenVideo, 1049 switches::kEnableOverlayFullscreenVideo,
1039 switches::kEnableOverlayScrollbar, 1050 switches::kEnableOverlayScrollbar,
1040 switches::kEnableOverscrollNotifications, 1051 switches::kEnableOverscrollNotifications,
1041 switches::kEnablePinch, 1052 switches::kEnablePinch,
1042 switches::kEnablePreparsedJsCaching, 1053 switches::kEnablePreparsedJsCaching,
1043 switches::kEnablePruneGpuCommandBuffers, 1054 switches::kEnablePruneGpuCommandBuffers,
1044 switches::kEnableRepaintAfterLayout, 1055 switches::kEnableRepaintAfterLayout,
1045 switches::kEnableServiceWorker, 1056 switches::kEnableServiceWorker,
1046 switches::kEnableSkiaBenchmarking, 1057 switches::kEnableSkiaBenchmarking,
1047 switches::kEnableSoftwareCompositing, 1058 switches::kEnableSoftwareCompositing,
1048 switches::kEnableSpeechSynthesis, 1059 switches::kEnableSpeechSynthesis,
1049 switches::kEnableStatsTable, 1060 switches::kEnableStatsTable,
1050 switches::kEnableStrictSiteIsolation, 1061 switches::kEnableStrictSiteIsolation,
1051 switches::kEnableTargetedStyleRecalc, 1062 switches::kEnableTargetedStyleRecalc,
1052 switches::kEnableThreadedCompositing, 1063 switches::kEnableThreadedCompositing,
1053 switches::kEnableUniversalAcceleratedOverflowScroll, 1064 switches::kEnableUniversalAcceleratedOverflowScroll,
1054 switches::kEnableTouchDragDrop, 1065 switches::kEnableTouchDragDrop,
1055 switches::kEnableTouchEditing, 1066 switches::kEnableTouchEditing,
1056 switches::kEnableViewport, 1067 switches::kEnableViewport,
1057 switches::kEnableViewportMeta, 1068 switches::kEnableViewportMeta,
1058 switches::kMainFrameResizesAreOrientationChanges, 1069 switches::kMainFrameResizesAreOrientationChanges,
1059 switches::kEnableVtune, 1070 switches::kEnableVtune,
1060 switches::kEnableWebAnimationsSVG, 1071 switches::kEnableWebAnimationsSVG,
1061 switches::kEnableWebGLDraftExtensions, 1072 switches::kEnableWebGLDraftExtensions,
1062 switches::kEnableWebMIDI, 1073 switches::kEnableWebMIDI,
1063 switches::kForceDeviceScaleFactor, 1074 switches::kForceDeviceScaleFactor,
1075 switches::kForceGpuRasterization,
1064 switches::kFullMemoryCrashReport, 1076 switches::kFullMemoryCrashReport,
1065 switches::kJavaScriptFlags, 1077 switches::kJavaScriptFlags,
1066 switches::kLoggingLevel, 1078 switches::kLoggingLevel,
1067 switches::kMaxUntiledLayerWidth, 1079 switches::kMaxUntiledLayerWidth,
1068 switches::kMaxUntiledLayerHeight, 1080 switches::kMaxUntiledLayerHeight,
1069 switches::kMemoryMetrics, 1081 switches::kMemoryMetrics,
1070 switches::kNoReferrers, 1082 switches::kNoReferrers,
1071 switches::kNoSandbox, 1083 switches::kNoSandbox,
1072 switches::kNumRasterThreads, 1084 switches::kNumRasterThreads,
1073 switches::kPpapiInProcess, 1085 switches::kPpapiInProcess,
(...skipping 17 matching lines...) Expand all
1091 switches::kV, 1103 switches::kV,
1092 switches::kVideoThreads, 1104 switches::kVideoThreads,
1093 switches::kVModule, 1105 switches::kVModule,
1094 switches::kWebGLCommandBufferSizeKb, 1106 switches::kWebGLCommandBufferSizeKb,
1095 // Please keep these in alphabetical order. Compositor switches here should 1107 // Please keep these in alphabetical order. Compositor switches here should
1096 // also be added to chrome/browser/chromeos/login/chrome_restart_request.cc. 1108 // also be added to chrome/browser/chromeos/login/chrome_restart_request.cc.
1097 cc::switches::kBackgroundColorInsteadOfCheckerboard, 1109 cc::switches::kBackgroundColorInsteadOfCheckerboard,
1098 cc::switches::kCompositeToMailbox, 1110 cc::switches::kCompositeToMailbox,
1099 cc::switches::kDisableCompositedAntialiasing, 1111 cc::switches::kDisableCompositedAntialiasing,
1100 cc::switches::kDisableCompositorTouchHitTesting, 1112 cc::switches::kDisableCompositorTouchHitTesting,
1101 cc::switches::kDisableGPURasterization,
1102 cc::switches::kDisableImplSidePainting,
1103 cc::switches::kDisableLCDText,
1104 cc::switches::kDisableMapImage,
1105 cc::switches::kDisableThreadedAnimation, 1113 cc::switches::kDisableThreadedAnimation,
1106 cc::switches::kEnableGpuBenchmarking, 1114 cc::switches::kEnableGpuBenchmarking,
1107 cc::switches::kEnableGPURasterization,
1108 cc::switches::kEnableImplSidePainting,
1109 cc::switches::kEnableLCDText,
1110 cc::switches::kEnableMapImage,
1111 cc::switches::kEnablePinchVirtualViewport, 1115 cc::switches::kEnablePinchVirtualViewport,
1112 cc::switches::kEnableTopControlsPositionCalculation, 1116 cc::switches::kEnableTopControlsPositionCalculation,
1113 cc::switches::kMaxTilesForInterestArea, 1117 cc::switches::kMaxTilesForInterestArea,
1114 cc::switches::kMaxUnusedResourceMemoryUsagePercentage, 1118 cc::switches::kMaxUnusedResourceMemoryUsagePercentage,
1115 cc::switches::kShowCompositedLayerBorders, 1119 cc::switches::kShowCompositedLayerBorders,
1116 cc::switches::kShowFPSCounter, 1120 cc::switches::kShowFPSCounter,
1117 cc::switches::kShowLayerAnimationBounds, 1121 cc::switches::kShowLayerAnimationBounds,
1118 cc::switches::kShowNonOccludingRects, 1122 cc::switches::kShowNonOccludingRects,
1119 cc::switches::kShowOccludingRects, 1123 cc::switches::kShowOccludingRects,
1120 cc::switches::kShowPropertyChangedRects, 1124 cc::switches::kShowPropertyChangedRects,
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
1184 // Disable databases in incognito mode. 1188 // Disable databases in incognito mode.
1185 if (GetBrowserContext()->IsOffTheRecord() && 1189 if (GetBrowserContext()->IsOffTheRecord() &&
1186 !browser_cmd.HasSwitch(switches::kDisableDatabases)) { 1190 !browser_cmd.HasSwitch(switches::kDisableDatabases)) {
1187 renderer_cmd->AppendSwitch(switches::kDisableDatabases); 1191 renderer_cmd->AppendSwitch(switches::kDisableDatabases);
1188 #if defined(OS_ANDROID) 1192 #if defined(OS_ANDROID)
1189 renderer_cmd->AppendSwitch(switches::kDisableMediaHistoryLogging); 1193 renderer_cmd->AppendSwitch(switches::kDisableMediaHistoryLogging);
1190 #endif 1194 #endif
1191 } 1195 }
1192 1196
1193 // Enforce the extra command line flags for impl-side painting. 1197 // Enforce the extra command line flags for impl-side painting.
1194 if (cc::switches::IsImplSidePaintingEnabled() && 1198 if (IsImplSidePaintingEnabled() &&
1195 !browser_cmd.HasSwitch(switches::kEnableDeferredImageDecoding)) 1199 !browser_cmd.HasSwitch(switches::kEnableDeferredImageDecoding))
1196 renderer_cmd->AppendSwitch(switches::kEnableDeferredImageDecoding); 1200 renderer_cmd->AppendSwitch(switches::kEnableDeferredImageDecoding);
1197 } 1201 }
1198 1202
1199 base::ProcessHandle RenderProcessHostImpl::GetHandle() const { 1203 base::ProcessHandle RenderProcessHostImpl::GetHandle() const {
1200 if (run_renderer_in_process()) 1204 if (run_renderer_in_process())
1201 return base::Process::Current().handle(); 1205 return base::Process::Current().handle();
1202 1206
1203 if (!child_process_launcher_.get() || child_process_launcher_->IsStarting()) 1207 if (!child_process_launcher_.get() || child_process_launcher_->IsStarting())
1204 return base::kNullProcessHandle; 1208 return base::kNullProcessHandle;
(...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after
2092 2096
2093 void RenderProcessHostImpl::DecrementWorkerRefCount() { 2097 void RenderProcessHostImpl::DecrementWorkerRefCount() {
2094 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 2098 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
2095 DCHECK_GT(worker_ref_count_, 0); 2099 DCHECK_GT(worker_ref_count_, 0);
2096 --worker_ref_count_; 2100 --worker_ref_count_;
2097 if (worker_ref_count_ == 0) 2101 if (worker_ref_count_ == 0)
2098 Cleanup(); 2102 Cleanup();
2099 } 2103 }
2100 2104
2101 } // namespace content 2105 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698