Move some content_switches into blink.
These switches will be used inside blink when the LayerTreeSettings
are created solely in blink (instead of at the content layer). In order
to do that we have to move some switches first.
BUG=1097816
Change-Id: I5771d65c454dd6bb276270f90f1f8f7df556ee65
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2260938
Reviewed-by: Wez <[email protected]>
Reviewed-by: Kentaro Hara <[email protected]>
Commit-Queue: Dave Tapuska <[email protected]>
Cr-Commit-Position: refs/heads/master@{#782444}
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index 353cac3..fdec331 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -165,6 +165,7 @@
#include "third_party/blink/public/common/experiments/memory_ablation_experiment.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/forcedark/forcedark_switches.h"
+#include "third_party/blink/public/common/switches.h"
#include "third_party/leveldatabase/leveldb_features.h"
#include "ui/accessibility/accessibility_features.h"
#include "ui/accessibility/accessibility_switches.h"
@@ -2500,8 +2501,8 @@
#endif // OS_ANDROID
{"enable-zero-copy", flag_descriptions::kZeroCopyName,
flag_descriptions::kZeroCopyDescription, kOsAll,
- ENABLE_DISABLE_VALUE_TYPE(switches::kEnableZeroCopy,
- switches::kDisableZeroCopy)},
+ ENABLE_DISABLE_VALUE_TYPE(blink::switches::kEnableZeroCopy,
+ blink::switches::kDisableZeroCopy)},
{"enable-vulkan", flag_descriptions::kEnableVulkanName,
flag_descriptions::kEnableVulkanDescription,
kOsWin | kOsLinux | kOsAndroid, FEATURE_VALUE_TYPE(features::kVulkan)},
diff --git a/chrome/browser/chromeos/login/chrome_restart_request.cc b/chrome/browser/chromeos/login/chrome_restart_request.cc
index 137fb6571..e54c8c8a 100644
--- a/chrome/browser/chromeos/login/chrome_restart_request.cc
+++ b/chrome/browser/chromeos/login/chrome_restart_request.cc
@@ -48,6 +48,7 @@
#include "media/capture/capture_switches.h"
#include "media/media_buildflags.h"
#include "services/service_manager/sandbox/switches.h"
+#include "third_party/blink/public/common/switches.h"
#include "third_party/cros_system_api/switches/chrome_switches.h"
#include "ui/base/ui_base_switches.h"
#include "ui/display/display_switches.h"
@@ -99,32 +100,25 @@
::switches::kDisableGpuWatchdog,
::switches::kDisableGpuCompositing,
::switches::kDisableGpuRasterization,
- ::switches::kDisableLowResTiling,
::switches::kDisableOopRasterization,
- ::switches::kDisablePartialRaster,
::switches::kDisablePepper3DImageChromium,
::switches::kDisablePreferCompositingToLCDText,
- ::switches::kDisableRGBA4444Textures,
::switches::kDisableThreadedScrolling,
::switches::kDisableTouchDragDrop,
::switches::kDisableVideoCaptureUseGpuMemoryBuffer,
::switches::kDisableYUVImageDecoding,
- ::switches::kDisableZeroCopy,
::switches::kEnableBlinkFeatures,
::switches::kEnableGpuMemoryBufferVideoFrames,
::switches::kEnableGpuRasterization,
::switches::kEnableLogging,
- ::switches::kEnableLowResTiling,
::switches::kEnableNativeGpuMemoryBuffers,
::switches::kEnableOopRasterization,
::switches::kEnablePreferCompositingToLCDText,
- ::switches::kEnableRGBA4444Textures,
::switches::kEnableTouchDragDrop,
::switches::kEnableUnifiedDesktop,
::switches::kEnableUseHDRTransferFunction,
::switches::kEnableUseZoomForDSF,
::switches::kEnableViewport,
- ::switches::kEnableZeroCopy,
::switches::kEnableHardwareOverlays,
::switches::kEdgeTouchFiltering,
#if BUILDFLAG(USE_CHROMEOS_MEDIA_ACCELERATION)
@@ -134,7 +128,6 @@
::switches::kMainFrameResizesAreOrientationChanges,
::switches::kForceDeviceScaleFactor,
::switches::kForceGpuMemAvailableMb,
- ::switches::kGpuRasterizationMSAASampleCount,
::switches::kGpuStartupDialog,
::switches::kGpuSandboxStartEarly,
::switches::kNumRasterThreads,
@@ -173,6 +166,14 @@
ash::switches::kAuraLegacyPowerButton,
ash::switches::kEnableDimShelf,
ash::switches::kShowTaps,
+ blink::switches::kDisableLowResTiling,
+ blink::switches::kDisablePartialRaster,
+ blink::switches::kDisableRGBA4444Textures,
+ blink::switches::kDisableZeroCopy,
+ blink::switches::kEnableLowResTiling,
+ blink::switches::kEnableRGBA4444Textures,
+ blink::switches::kEnableZeroCopy,
+ blink::switches::kGpuRasterizationMSAASampleCount,
chromeos::switches::kDefaultWallpaperLarge,
chromeos::switches::kDefaultWallpaperSmall,
chromeos::switches::kGuestWallpaperLarge,
diff --git a/content/browser/gpu/compositor_util.cc b/content/browser/gpu/compositor_util.cc
index 6e6de4c..4cdcc399 100644
--- a/content/browser/gpu/compositor_util.cc
+++ b/content/browser/gpu/compositor_util.cc
@@ -37,6 +37,7 @@
#include "gpu/ipc/host/gpu_memory_buffer_support.h"
#include "gpu/vulkan/buildflags.h"
#include "media/media_buildflags.h"
+#include "third_party/blink/public/common/switches.h"
#include "ui/gl/gl_switches.h"
namespace content {
@@ -411,22 +412,22 @@
const base::CommandLine& command_line =
*base::CommandLine::ForCurrentProcess();
#if defined(OS_MACOSX)
- return !command_line.HasSwitch(switches::kDisableZeroCopy);
+ return !command_line.HasSwitch(blink::switches::kDisableZeroCopy);
#else
- return command_line.HasSwitch(switches::kEnableZeroCopy);
+ return command_line.HasSwitch(blink::switches::kEnableZeroCopy);
#endif
}
bool IsPartialRasterEnabled() {
const auto& command_line = *base::CommandLine::ForCurrentProcess();
- return !command_line.HasSwitch(switches::kDisablePartialRaster);
+ return !command_line.HasSwitch(blink::switches::kDisablePartialRaster);
}
bool IsGpuMemoryBufferCompositorResourcesEnabled() {
const base::CommandLine& command_line =
*base::CommandLine::ForCurrentProcess();
if (command_line.HasSwitch(
- switches::kEnableGpuMemoryBufferCompositorResources)) {
+ blink::switches::kEnableGpuMemoryBufferCompositorResources)) {
return true;
}
if (command_line.HasSwitch(
@@ -445,7 +446,8 @@
const base::CommandLine& command_line =
*base::CommandLine::ForCurrentProcess();
- if (!command_line.HasSwitch(switches::kGpuRasterizationMSAASampleCount))
+ if (!command_line.HasSwitch(
+ blink::switches::kGpuRasterizationMSAASampleCount))
#if defined(OS_ANDROID)
return 4;
#else
@@ -453,14 +455,14 @@
return -1;
#endif
std::string string_value = command_line.GetSwitchValueASCII(
- switches::kGpuRasterizationMSAASampleCount);
+ blink::switches::kGpuRasterizationMSAASampleCount);
int msaa_sample_count = 0;
if (base::StringToInt(string_value, &msaa_sample_count) &&
msaa_sample_count >= kMinMSAASampleCount) {
return msaa_sample_count;
} else {
DLOG(WARNING) << "Failed to parse switch "
- << switches::kGpuRasterizationMSAASampleCount << ": "
+ << blink::switches::kGpuRasterizationMSAASampleCount << ": "
<< string_value;
return 0;
}
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 792e359..005e04a 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -3193,18 +3193,19 @@
int msaa_sample_count = GpuRasterizationMSAASampleCount();
if (msaa_sample_count >= 0) {
- command_line->AppendSwitchASCII(switches::kGpuRasterizationMSAASampleCount,
- base::NumberToString(msaa_sample_count));
+ command_line->AppendSwitchASCII(
+ blink::switches::kGpuRasterizationMSAASampleCount,
+ base::NumberToString(msaa_sample_count));
}
if (IsZeroCopyUploadEnabled())
- command_line->AppendSwitch(switches::kEnableZeroCopy);
+ command_line->AppendSwitch(blink::switches::kEnableZeroCopy);
if (!IsPartialRasterEnabled())
- command_line->AppendSwitch(switches::kDisablePartialRaster);
+ command_line->AppendSwitch(blink::switches::kDisablePartialRaster);
if (IsGpuMemoryBufferCompositorResourcesEnabled()) {
command_line->AppendSwitch(
- switches::kEnableGpuMemoryBufferCompositorResources);
+ blink::switches::kEnableGpuMemoryBufferCompositorResources);
}
if (IsMainFrameBeforeActivationEnabled())
@@ -3281,9 +3282,6 @@
switches::kAudioBufferSize,
switches::kAutoplayPolicy,
switches::kBlinkSettings,
- switches::kDefaultTileWidth,
- switches::kDefaultTileHeight,
- switches::kMinHeightForGpuRasterTile,
switches::kMojoCoreLibraryPath,
switches::kDisable2dCanvasImageChromium,
switches::kDisableYUVImageDecoding,
@@ -3296,8 +3294,6 @@
switches::kDisableFileSystem,
switches::kDisableFrameRateLimit,
switches::kDisableGpuMemoryBufferVideoFrames,
- switches::kDisableImageAnimationResync,
- switches::kDisableLowResTiling,
switches::kDisableHistogramCustomizer,
switches::kDisableLCDText,
switches::kDisableLogging,
@@ -3309,7 +3305,6 @@
switches::kDisablePepper3DImageChromium,
switches::kDisablePermissionsAPI,
switches::kDisablePresentationAPI,
- switches::kDisableRGBA4444Textures,
switches::kDisableRTCSmoothnessAlgorithm,
switches::kDisableScrollToTextFragment,
switches::kDisableSharedWorkers,
@@ -3332,7 +3327,6 @@
switches::kEnableGpuClientTracing,
switches::kEnableGpuMemoryBufferVideoFrames,
switches::kEnableGPUServiceLogging,
- switches::kEnableLowResTiling,
switches::kEnableLCDText,
switches::kEnableLogging,
switches::kEnableNetworkInformationDownlinkMax,
@@ -3340,7 +3334,6 @@
switches::kEnablePluginPlaceholderTesting,
switches::kEnablePreciseMemoryInfo,
switches::kEnablePreferCompositingToLCDText,
- switches::kEnableRGBA4444Textures,
switches::kEnableSkiaBenchmarking,
switches::kEnableThreadedCompositing,
switches::kEnableTouchDragDrop,
@@ -3366,8 +3359,6 @@
switches::kLogFile,
switches::kLoggingLevel,
switches::kMaxActiveWebGLContexts,
- switches::kMaxUntiledLayerWidth,
- switches::kMaxUntiledLayerHeight,
switches::kMSEAudioBufferSizeLimitMb,
switches::kMSEVideoBufferSizeLimitMb,
switches::kNetworkQuietTimeout,
@@ -3384,8 +3375,6 @@
switches::kRemoteDebuggingPort,
switches::kRendererStartupDialog,
switches::kReportVp9AsAnUnsupportedMimeType,
- switches::kShowLayoutShiftRegions,
- switches::kShowPaintRects,
switches::kStatsCollectionController,
switches::kSkiaFontCacheLimitMb,
switches::kSkiaResourceCacheLimitMb,
@@ -3405,6 +3394,18 @@
switches::kWebglMSAASampleCount,
// Please keep these in alphabetical order.
blink::switches::kAllowPreCommitInput,
+ blink::switches::kDefaultTileWidth,
+ blink::switches::kDefaultTileHeight,
+ blink::switches::kDisableImageAnimationResync,
+ blink::switches::kDisableLowResTiling,
+ blink::switches::kDisableRGBA4444Textures,
+ blink::switches::kEnableLowResTiling,
+ blink::switches::kEnableRGBA4444Textures,
+ blink::switches::kMinHeightForGpuRasterTile,
+ blink::switches::kMaxUntiledLayerWidth,
+ blink::switches::kMaxUntiledLayerHeight,
+ blink::switches::kShowLayoutShiftRegions,
+ blink::switches::kShowPaintRects,
// Please keep these in alphabetical order. Compositor switches here
// should also be added to
// chrome/browser/chromeos/login/chrome_restart_request.cc.
diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc
index 60d5942..19fc50b 100644
--- a/content/child/runtime_features.cc
+++ b/content/child/runtime_features.cc
@@ -26,6 +26,7 @@
#include "services/network/public/cpp/features.h"
#include "services/network/public/cpp/network_switches.h"
#include "third_party/blink/public/common/features.h"
+#include "third_party/blink/public/common/switches.h"
#include "third_party/blink/public/platform/web_runtime_features.h"
#include "ui/accessibility/accessibility_features.h"
#include "ui/base/ui_base_features.h"
@@ -75,7 +76,7 @@
#if defined(OS_MACOSX)
const bool enable_canvas_2d_image_chromium =
command_line.HasSwitch(
- switches::kEnableGpuMemoryBufferCompositorResources) &&
+ blink::switches::kEnableGpuMemoryBufferCompositorResources) &&
!command_line.HasSwitch(switches::kDisable2dCanvasImageChromium) &&
!command_line.HasSwitch(switches::kDisableGpu) &&
base::FeatureList::IsEnabled(features::kCanvas2DImageChromium);
@@ -88,7 +89,7 @@
#if defined(OS_MACOSX)
const bool enable_web_gl_image_chromium =
command_line.HasSwitch(
- switches::kEnableGpuMemoryBufferCompositorResources) &&
+ blink::switches::kEnableGpuMemoryBufferCompositorResources) &&
!command_line.HasSwitch(switches::kDisableWebGLImageChromium) &&
!command_line.HasSwitch(switches::kDisableGpu) &&
base::FeatureList::IsEnabled(features::kWebGLImageChromium);
diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc
index 4742165..7d64de9a0 100644
--- a/content/public/common/content_switches.cc
+++ b/content/public/common/content_switches.cc
@@ -66,13 +66,6 @@
// Causes the Conversion Measurement API to run without delays or noise.
const char kConversionsDebugMode[] = "conversions-debug-mode";
-// Sets the tile size used by composited layers.
-const char kDefaultTileWidth[] = "default-tile-width";
-const char kDefaultTileHeight[] = "default-tile-height";
-
-// Sets the min tile height for GPU raster.
-const char kMinHeightForGpuRasterTile[] = "min-height-for-gpu-raster-tile";
-
// Disable antialiasing on 2d canvas.
const char kDisable2dCanvasAntialiasing[] = "disable-canvas-aa";
@@ -172,19 +165,10 @@
const char kDisableSoftwareCompositingFallback[] =
"disable-software-compositing-fallback";
-// When using CPU rasterizing disable low resolution tiling. This uses
-// less power, particularly during animations, but more white may be seen
-// during fast scrolling especially on slower devices.
-const char kDisableLowResTiling[] = "disable-low-res-tiling";
-
// Disable the thread that crashes the GPU process if it stops responding to
// messages.
const char kDisableGpuWatchdog[] = "disable-gpu-watchdog";
-// Disallow image animations to be reset to the beginning to avoid skipping
-// many frames. Only effective if compositor image animations are enabled.
-const char kDisableImageAnimationResync[] = "disable-image-animation-resync";
-
// Disables the IPC flooding protection.
// It is activated by default. Some javascript functions can be used to flood
// the browser process with IPC. This protection limits the rate at which they
@@ -225,10 +209,6 @@
// Disables the Web Notification and the Push APIs.
const char kDisableNotifications[] = "disable-notifications";
-// Disable partial raster in the renderer. Disabling this switch also disables
-// the use of persistent gpu memory buffers.
-const char kDisablePartialRaster[] = "disable-partial-raster";
-
// Disable Pepper3D.
const char kDisablePepper3d[] = "disable-pepper-3d";
@@ -251,9 +231,6 @@
// Disables throttling of history.pushState/replaceState calls.
const char kDisablePushStateThrottle[] = "disable-pushstate-throttle";
-// Disables RGBA_4444 textures.
-const char kDisableRGBA4444Textures[] = "disable-rgba-4444-textures";
-
// Taints all <canvas> elements, regardless of origin.
const char kDisableReadingFromCanvas[] = "disable-reading-from-canvas";
@@ -311,9 +288,6 @@
// Don't enforce the same-origin policy. (Used by people testing their sites.)
const char kDisableWebSecurity[] = "disable-web-security";
-// Disable rasterizer that writes directly to GPU memory associated with tiles.
-const char kDisableZeroCopy[] = "disable-zero-copy";
-
// Disable the video decoder from drawing directly to a texture.
const char kDisableZeroCopyDxgiVideo[] = "disable-zero-copy-dxgi-video";
@@ -385,18 +359,10 @@
const char kDisableOriginTrialControlledBlinkFeatures[] =
"disable-origin-trial-controlled-blink-features";
-// Specify that all compositor resources should be backed by GPU memory buffers.
-const char kEnableGpuMemoryBufferCompositorResources[] =
- "enable-gpu-memory-buffer-compositor-resources";
-
// Enable GpuMemoryBuffer backed VideoFrames.
const char kEnableGpuMemoryBufferVideoFrames[] =
"enable-gpu-memory-buffer-video-frames";
-// When using CPU rasterizing generate low resolution tiling. Low res
-// tiles may be displayed during fast scrolls especially on slower devices.
-const char kEnableLowResTiling[] = "enable-low-res-tiling";
-
// Force logging to be enabled. Logging is disabled by default in release
// builds.
const char kEnableLogging[] = "enable-logging";
@@ -420,9 +386,6 @@
// also applys to workers.
const char kEnablePreciseMemoryInfo[] = "enable-precise-memory-info";
-// Enables RGBA_4444 textures.
-const char kEnableRGBA4444Textures[] = "enable-rgba-4444-textures";
-
// Set options to cache V8 data. (off, preparse data, or code)
const char kV8CacheOptions[] = "v8-cache-options";
@@ -490,9 +453,6 @@
// Enables WebGL rendering into a scanout buffer for overlay support.
const char kEnableWebGLImageChromium[] = "enable-webgl-image-chromium";
-// Enable rasterizer that writes directly to GPU memory associated with tiles.
-const char kEnableZeroCopy[] = "enable-zero-copy";
-
// Handle to the shared memory segment containing field trial state that is to
// be shared between processes. The argument to this switch is the handle id
// (pointer on Windows) as a string, followed by a comma, then the size of the
@@ -518,11 +478,6 @@
const char kForceLegacyDefaultReferrerPolicy[] =
"force-legacy-default-referrer-policy";
-// The number of multisample antialiasing samples for GPU rasterization.
-// Requires MSAA support on GPU to have an effect. 0 disables MSAA.
-const char kGpuRasterizationMSAASampleCount[] =
- "gpu-rasterization-msaa-sample-count";
-
// Forces use of hardware overlay for fullscreen video playback. Useful for
// testing the Android overlay fullscreen functionality on other platforms.
const char kForceOverlayFullscreenVideo[] = "force-overlay-fullscreen-video";
@@ -609,10 +564,6 @@
// Sets the maximium decoded image size limitation.
const char kMaxDecodedImageSizeMb[] = "max-decoded-image-size-mb";
-// Sets the width and height above which a composited layer will get tiled.
-const char kMaxUntiledLayerHeight[] = "max-untiled-layer-height";
-const char kMaxUntiledLayerWidth[] = "max-untiled-layer-width";
-
// Indicates the utility process should run with a message loop type of UI.
const char kMessageLoopTypeUi[] = "message-loop-type-ui";
@@ -759,14 +710,6 @@
// Causes the process to run as a sandbox IPC subprocess.
const char kSandboxIPCProcess[] = "sandbox-ipc";
-// Visibly render a border around layout shift rects in the web page to help
-// debug and study layout shifts.
-const char kShowLayoutShiftRegions[] = "show-layout-shift-regions";
-
-// Visibly render a border around paint rects in the web page to help debug
-// and study painting behavior.
-const char kShowPaintRects[] = "show-paint-rects";
-
// Runs the renderer and plugins in the same process as the browser
const char kSingleProcess[] = "single-process";
diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h
index 37700c3..73bcf1a5 100644
--- a/content/public/common/content_switches.h
+++ b/content/public/common/content_switches.h
@@ -29,9 +29,6 @@
CONTENT_EXPORT extern const char kBrowserSubprocessPath[];
CONTENT_EXPORT extern const char kBrowserTest[];
CONTENT_EXPORT extern const char kConversionsDebugMode[];
-CONTENT_EXPORT extern const char kDefaultTileWidth[];
-CONTENT_EXPORT extern const char kDefaultTileHeight[];
-CONTENT_EXPORT extern const char kMinHeightForGpuRasterTile[];
CONTENT_EXPORT extern const char kDisable2dCanvasAntialiasing[];
CONTENT_EXPORT extern const char kDisable2dCanvasImageChromium[];
CONTENT_EXPORT extern const char kDisable3DAPIs[];
@@ -61,11 +58,9 @@
extern const char kDisableGpuProcessCrashLimit[];
CONTENT_EXPORT extern const char kDisableSoftwareCompositingFallback[];
CONTENT_EXPORT extern const char kDisableGpuWatchdog[];
-CONTENT_EXPORT extern const char kDisableImageAnimationResync[];
CONTENT_EXPORT extern const char kDisableIpcFloodingProtection[];
CONTENT_EXPORT extern const char kDisableJavaScriptHarmonyShipping[];
CONTENT_EXPORT extern const char kDisableLowLatencyDxva[];
-CONTENT_EXPORT extern const char kDisableLowResTiling[];
CONTENT_EXPORT extern const char kDisableHangMonitor[];
extern const char kDisableHistogramCustomizer[];
CONTENT_EXPORT extern const char kDisableLCDText[];
@@ -76,14 +71,12 @@
CONTENT_EXPORT extern const char kDisableNewContentRenderingTimeout[];
CONTENT_EXPORT extern const char kDisableNotifications[];
CONTENT_EXPORT extern const char kDisableOriginTrialControlledBlinkFeatures[];
-CONTENT_EXPORT extern const char kDisablePartialRaster[];
extern const char kDisablePepper3d[];
CONTENT_EXPORT extern const char kDisablePepper3DImageChromium[];
CONTENT_EXPORT extern const char kDisablePermissionsAPI[];
CONTENT_EXPORT extern const char kDisablePinch[];
CONTENT_EXPORT extern const char kDisablePresentationAPI[];
CONTENT_EXPORT extern const char kDisablePushStateThrottle[];
-CONTENT_EXPORT extern const char kDisableRGBA4444Textures[];
CONTENT_EXPORT extern const char kDisableReadingFromCanvas[];
extern const char kDisableRemoteFonts[];
CONTENT_EXPORT extern const char kDisableRemotePlaybackAPI[];
@@ -102,7 +95,6 @@
extern const char kDisableV8IdleTasks[];
CONTENT_EXPORT extern const char kDisableWebGLImageChromium[];
CONTENT_EXPORT extern const char kDisableWebSecurity[];
-CONTENT_EXPORT extern const char kDisableZeroCopy[];
CONTENT_EXPORT extern const char kDisableZeroCopyDxgiVideo[];
CONTENT_EXPORT extern const char kDomAutomationController[];
extern const char kDisable2dCanvasClipAntialiasing[];
@@ -118,10 +110,7 @@
CONTENT_EXPORT extern const char kEnableExperimentalWebAssemblyFeatures[];
CONTENT_EXPORT extern const char kEnableExperimentalWebPlatformFeatures[];
CONTENT_EXPORT extern const char kEnableFtp[];
-CONTENT_EXPORT extern const char kEnableGpuMemoryBufferCompositorResources[];
CONTENT_EXPORT extern const char kEnableGpuMemoryBufferVideoFrames[];
-CONTENT_EXPORT extern const char kGpuRasterizationMSAASampleCount[];
-CONTENT_EXPORT extern const char kEnableLowResTiling[];
CONTENT_EXPORT extern const char kEnableLCDText[];
CONTENT_EXPORT extern const char kEnableLogging[];
CONTENT_EXPORT extern const char kEnableNetworkInformationDownlinkMax[];
@@ -129,7 +118,6 @@
CONTENT_EXPORT extern const char kDisableNv12DxgiVideo[];
CONTENT_EXPORT extern const char kEnablePluginPlaceholderTesting[];
CONTENT_EXPORT extern const char kEnablePreciseMemoryInfo[];
-CONTENT_EXPORT extern const char kEnableRGBA4444Textures[];
CONTENT_EXPORT extern const char kEnableServiceBinaryLauncher[];
extern const char kEnableSkiaBenchmarking[];
CONTENT_EXPORT extern const char kEnableSmoothScrolling[];
@@ -148,7 +136,6 @@
CONTENT_EXPORT extern const char kEnableWebGLDraftExtensions[];
CONTENT_EXPORT extern const char kEnableWebGLImageChromium[];
CONTENT_EXPORT extern const char kEnableWebVR[];
-CONTENT_EXPORT extern const char kEnableZeroCopy[];
CONTENT_EXPORT extern const char kFieldTrialHandle[];
CONTENT_EXPORT extern const char kFileUrlPathAlias[];
CONTENT_EXPORT extern const char kForceDisplayList2dCanvas[];
@@ -176,8 +163,6 @@
CONTENT_EXPORT extern const char kMainFrameResizesAreOrientationChanges[];
extern const char kMaxActiveWebGLContexts[];
extern const char kMaxDecodedImageSizeMb[];
-extern const char kMaxUntiledLayerHeight[];
-extern const char kMaxUntiledLayerWidth[];
CONTENT_EXPORT extern const char kMessageLoopTypeUi[];
CONTENT_EXPORT extern const char kMHTMLGeneratorOption[];
CONTENT_EXPORT extern const char kMHTMLSkipNostoreMain[];
@@ -212,8 +197,6 @@
CONTENT_EXPORT extern const char kRendererStartupDialog[];
CONTENT_EXPORT extern const char kRunManualTestsFlag[];
extern const char kSandboxIPCProcess[];
-extern const char kShowLayoutShiftRegions[];
-extern const char kShowPaintRects[];
CONTENT_EXPORT extern const char kSingleProcess[];
CONTENT_EXPORT extern const char kSitePerProcess[];
CONTENT_EXPORT extern const char kDisableSiteIsolation[];
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index 8cbd82f..baee6cb 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -125,6 +125,7 @@
#include "services/viz/public/cpp/gpu/gpu.h"
#include "skia/ext/skia_memory_dump_provider.h"
#include "third_party/blink/public/common/features.h"
+#include "third_party/blink/public/common/switches.h"
#include "third_party/blink/public/platform/modules/video_capture/web_video_capture_impl_manager.h"
#include "third_party/blink/public/platform/scheduler/web_thread_scheduler.h"
#include "third_party/blink/public/platform/web_cache.h"
@@ -654,11 +655,12 @@
is_threaded_animation_enabled_ =
!command_line.HasSwitch(cc::switches::kDisableThreadedAnimation);
- is_zero_copy_enabled_ = command_line.HasSwitch(switches::kEnableZeroCopy);
+ is_zero_copy_enabled_ =
+ command_line.HasSwitch(blink::switches::kEnableZeroCopy);
is_partial_raster_enabled_ =
- !command_line.HasSwitch(switches::kDisablePartialRaster);
+ !command_line.HasSwitch(blink::switches::kDisablePartialRaster);
is_gpu_memory_buffer_compositor_resources_enabled_ = command_line.HasSwitch(
- switches::kEnableGpuMemoryBufferCompositorResources);
+ blink::switches::kEnableGpuMemoryBufferCompositorResources);
// On macOS this value is adjusted in `UpdateScrollbarTheme()`,
// but the system default is true.
@@ -693,9 +695,10 @@
if (command_line.HasSwitch(switches::kDisableGpuCompositing))
is_gpu_compositing_disabled_ = true;
- if (command_line.HasSwitch(switches::kGpuRasterizationMSAASampleCount)) {
+ if (command_line.HasSwitch(
+ blink::switches::kGpuRasterizationMSAASampleCount)) {
std::string string_value = command_line.GetSwitchValueASCII(
- switches::kGpuRasterizationMSAASampleCount);
+ blink::switches::kGpuRasterizationMSAASampleCount);
bool parsed_msaa_sample_count =
base::StringToInt(string_value, &gpu_rasterization_msaa_sample_count_);
DCHECK(parsed_msaa_sample_count) << string_value;
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index d56b2a18..30e6638 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -2282,36 +2282,36 @@
// TODO(danakj): This should not be a setting O_O; it should change when the
// device scale factor on LayerTreeHost changes.
settings.default_tile_size = gfx::Size(default_tile_size, default_tile_size);
- if (cmd.HasSwitch(switches::kDefaultTileWidth)) {
+ if (cmd.HasSwitch(blink::switches::kDefaultTileWidth)) {
int tile_width = 0;
- switch_value_as_int(cmd, switches::kDefaultTileWidth, 1,
+ switch_value_as_int(cmd, blink::switches::kDefaultTileWidth, 1,
std::numeric_limits<int>::max(), &tile_width);
settings.default_tile_size.set_width(tile_width);
}
- if (cmd.HasSwitch(switches::kDefaultTileHeight)) {
+ if (cmd.HasSwitch(blink::switches::kDefaultTileHeight)) {
int tile_height = 0;
- switch_value_as_int(cmd, switches::kDefaultTileHeight, 1,
+ switch_value_as_int(cmd, blink::switches::kDefaultTileHeight, 1,
std::numeric_limits<int>::max(), &tile_height);
settings.default_tile_size.set_height(tile_height);
}
- if (cmd.HasSwitch(switches::kMinHeightForGpuRasterTile)) {
+ if (cmd.HasSwitch(blink::switches::kMinHeightForGpuRasterTile)) {
int min_height_for_gpu_raster_tile = 0;
- switch_value_as_int(cmd, switches::kMinHeightForGpuRasterTile, 1,
+ switch_value_as_int(cmd, blink::switches::kMinHeightForGpuRasterTile, 1,
std::numeric_limits<int>::max(),
&min_height_for_gpu_raster_tile);
settings.min_height_for_gpu_raster_tile = min_height_for_gpu_raster_tile;
}
int max_untiled_layer_width = settings.max_untiled_layer_size.width();
- if (cmd.HasSwitch(switches::kMaxUntiledLayerWidth)) {
- switch_value_as_int(cmd, switches::kMaxUntiledLayerWidth, 1,
+ if (cmd.HasSwitch(blink::switches::kMaxUntiledLayerWidth)) {
+ switch_value_as_int(cmd, blink::switches::kMaxUntiledLayerWidth, 1,
std::numeric_limits<int>::max(),
&max_untiled_layer_width);
}
int max_untiled_layer_height = settings.max_untiled_layer_size.height();
- if (cmd.HasSwitch(switches::kMaxUntiledLayerHeight)) {
- switch_value_as_int(cmd, switches::kMaxUntiledLayerHeight, 1,
+ if (cmd.HasSwitch(blink::switches::kMaxUntiledLayerHeight)) {
+ switch_value_as_int(cmd, blink::switches::kMaxUntiledLayerHeight, 1,
std::numeric_limits<int>::max(),
&max_untiled_layer_height);
}
@@ -2377,9 +2377,9 @@
settings.initial_debug_state.show_layer_animation_bounds_rects =
cmd.HasSwitch(cc::switches::kShowLayerAnimationBounds);
settings.initial_debug_state.show_paint_rects =
- cmd.HasSwitch(switches::kShowPaintRects);
+ cmd.HasSwitch(blink::switches::kShowPaintRects);
settings.initial_debug_state.show_layout_shift_regions =
- cmd.HasSwitch(switches::kShowLayoutShiftRegions);
+ cmd.HasSwitch(blink::switches::kShowLayoutShiftRegions);
settings.initial_debug_state.show_property_changed_rects =
cmd.HasSwitch(cc::switches::kShowPropertyChangedRects);
settings.initial_debug_state.show_surface_damage_rects =
@@ -2498,7 +2498,7 @@
// - If we are not using vulkan, since some GPU drivers don't support
// using RGBA4444 as color buffer.
// TODO(penghuang): query supported formats from GPU process.
- if (!cmd.HasSwitch(switches::kDisableRGBA4444Textures) &&
+ if (!cmd.HasSwitch(blink::switches::kDisableRGBA4444Textures) &&
base::SysInfo::AmountOfPhysicalMemoryMB() <= 512 &&
!using_synchronous_compositor &&
!base::FeatureList::IsEnabled(features::kVulkan)) {
@@ -2517,13 +2517,13 @@
}
}
- if (cmd.HasSwitch(switches::kEnableLowResTiling))
+ if (cmd.HasSwitch(blink::switches::kEnableLowResTiling))
settings.create_low_res_tiling = true;
- if (cmd.HasSwitch(switches::kDisableLowResTiling))
+ if (cmd.HasSwitch(blink::switches::kDisableLowResTiling))
settings.create_low_res_tiling = false;
- if (cmd.HasSwitch(switches::kEnableRGBA4444Textures) &&
- !cmd.HasSwitch(switches::kDisableRGBA4444Textures)) {
+ if (cmd.HasSwitch(blink::switches::kEnableRGBA4444Textures) &&
+ !cmd.HasSwitch(blink::switches::kDisableRGBA4444Textures)) {
settings.use_rgba_4444 = true;
}
@@ -2556,7 +2556,7 @@
}
settings.enable_image_animation_resync =
- !cmd.HasSwitch(switches::kDisableImageAnimationResync);
+ !cmd.HasSwitch(blink::switches::kDisableImageAnimationResync);
settings.send_compositor_frame_ack = false;
diff --git a/fuchsia/engine/DEPS b/fuchsia/engine/DEPS
index b074327..048342eb 100644
--- a/fuchsia/engine/DEPS
+++ b/fuchsia/engine/DEPS
@@ -10,6 +10,7 @@
"+media/fuchsia",
"+mojo/public",
"+services/service_manager",
+ "+third_party/blink/public/common/switches.h",
"+third_party/widevine/cdm/widevine_cdm_common.h",
"+ui/base",
"+ui/gfx",
diff --git a/fuchsia/engine/context_provider_impl.cc b/fuchsia/engine/context_provider_impl.cc
index 8e0bce7..9cc1ff2 100644
--- a/fuchsia/engine/context_provider_impl.cc
+++ b/fuchsia/engine/context_provider_impl.cc
@@ -54,6 +54,7 @@
#include "net/http/http_util.h"
#include "services/network/public/cpp/features.h"
#include "services/service_manager/sandbox/fuchsia/sandbox_policy_fuchsia.h"
+#include "third_party/blink/public/common/switches.h"
#include "third_party/widevine/cdm/widevine_cdm_common.h"
#include "ui/gfx/switches.h"
#include "ui/gl/gl_switches.h"
@@ -161,6 +162,8 @@
return true;
static const base::StringPiece kAllowedArgs[] = {
+ blink::switches::kGpuRasterizationMSAASampleCount,
+ blink::switches::kMinHeightForGpuRasterTile,
cc::switches::kEnableGpuBenchmarking,
switches::kDisableFeatures,
switches::kDisableGpuWatchdog,
@@ -171,8 +174,6 @@
switches::kForceGpuMemAvailableMb,
switches::kForceGpuMemDiscardableLimitMb,
switches::kForceMaxTextureSize,
- switches::kGpuRasterizationMSAASampleCount,
- switches::kMinHeightForGpuRasterTile,
switches::kRendererProcessLimit,
switches::kWebglAntialiasingMode,
switches::kWebglMSAASampleCount,
@@ -202,7 +203,7 @@
// which
// we don't yet support.
if (arg.first == switches::kEnableLowEndDeviceMode)
- command_line->AppendSwitch(switches::kDisableRGBA4444Textures);
+ command_line->AppendSwitch(blink::switches::kDisableRGBA4444Textures);
}
return true;
diff --git a/headless/app/DEPS b/headless/app/DEPS
index 7646185..a784e13 100644
--- a/headless/app/DEPS
+++ b/headless/app/DEPS
@@ -2,5 +2,6 @@
"+cc/base/switches.h",
"+components/viz/common/switches.h",
"+sandbox/mac",
+ "+third_party/blink/public/common/switches.h",
}
diff --git a/headless/app/headless_shell.cc b/headless/app/headless_shell.cc
index 4a89619..fc17e3f 100644
--- a/headless/app/headless_shell.cc
+++ b/headless/app/headless_shell.cc
@@ -47,6 +47,7 @@
#include "net/socket/ssl_client_socket.h"
#include "net/ssl/ssl_key_logger_impl.h"
#include "services/network/public/cpp/network_switches.h"
+#include "third_party/blink/public/common/switches.h"
#include "ui/gfx/geometry/size.h"
#if defined(OS_WIN)
@@ -687,7 +688,7 @@
command_line.AppendSwitch(::switches::kDisableNewContentRenderingTimeout);
// Ensure that image animations don't resync their animation timestamps when
// looping back around.
- command_line.AppendSwitch(::switches::kDisableImageAnimationResync);
+ command_line.AppendSwitch(blink::switches::kDisableImageAnimationResync);
// Renderer flags
command_line.AppendSwitch(cc::switches::kDisableThreadedAnimation);
diff --git a/headless/lib/headless_content_main_delegate.cc b/headless/lib/headless_content_main_delegate.cc
index 2ddeec83..6805126f 100644
--- a/headless/lib/headless_content_main_delegate.cc
+++ b/headless/lib/headless_content_main_delegate.cc
@@ -498,7 +498,7 @@
cc::switches::kDisableCheckerImaging,
// Ensure that image animations don't resync their animation timestamps
// when looping back around.
- ::switches::kDisableImageAnimationResync,
+ blink::switches::kDisableImageAnimationResync,
};
for (const auto* flag : switches)
base::CommandLine::ForCurrentProcess()->AppendSwitch(flag);
diff --git a/headless/test/DEPS b/headless/test/DEPS
index 518ed48..48997c4 100644
--- a/headless/test/DEPS
+++ b/headless/test/DEPS
@@ -3,5 +3,6 @@
"+cc/base/switches.h",
"+components/viz/common/features.h",
"+components/viz/common/switches.h",
+ "+third_party/blink/public/common/switches.h",
]
}
diff --git a/headless/test/headless_protocol_browsertest.cc b/headless/test/headless_protocol_browsertest.cc
index e231b6a9..fd966e8 100644
--- a/headless/test/headless_protocol_browsertest.cc
+++ b/headless/test/headless_protocol_browsertest.cc
@@ -26,6 +26,7 @@
#include "net/test/spawned_test_server/spawned_test_server.h"
#include "services/network/public/cpp/network_switches.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/blink/public/common/switches.h"
#include "url/url_util.h"
namespace headless {
@@ -304,7 +305,7 @@
// Ensure that image animations don't resync their animation timestamps
// when looping back around.
- switches::kDisableImageAnimationResync,
+ blink::switches::kDisableImageAnimationResync,
};
for (auto* compositor_switch : compositor_switches) {
diff --git a/third_party/blink/common/switches.cc b/third_party/blink/common/switches.cc
index dbb3b4a..31290d0 100644
--- a/third_party/blink/common/switches.cc
+++ b/third_party/blink/common/switches.cc
@@ -12,6 +12,48 @@
// involving a command line switch.
const char kAllowPreCommitInput[] = "allow-pre-commit-input";
+// Sets the tile size used by composited layers.
+const char kDefaultTileWidth[] = "default-tile-width";
+const char kDefaultTileHeight[] = "default-tile-height";
+
+// Disallow image animations to be reset to the beginning to avoid skipping
+// many frames. Only effective if compositor image animations are enabled.
+const char kDisableImageAnimationResync[] = "disable-image-animation-resync";
+
+// When using CPU rasterizing disable low resolution tiling. This uses
+// less power, particularly during animations, but more white may be seen
+// during fast scrolling especially on slower devices.
+const char kDisableLowResTiling[] = "disable-low-res-tiling";
+
+// Disable partial raster in the renderer. Disabling this switch also disables
+// the use of persistent gpu memory buffers.
+const char kDisablePartialRaster[] = "disable-partial-raster";
+
+// Disables RGBA_4444 textures.
+const char kDisableRGBA4444Textures[] = "disable-rgba-4444-textures";
+
+// Disable rasterizer that writes directly to GPU memory associated with tiles.
+const char kDisableZeroCopy[] = "disable-zero-copy";
+
+// Specify that all compositor resources should be backed by GPU memory buffers.
+const char kEnableGpuMemoryBufferCompositorResources[] =
+ "enable-gpu-memory-buffer-compositor-resources";
+
+// When using CPU rasterizing generate low resolution tiling. Low res
+// tiles may be displayed during fast scrolls especially on slower devices.
+const char kEnableLowResTiling[] = "enable-low-res-tiling";
+
+// Enables RGBA_4444 textures.
+const char kEnableRGBA4444Textures[] = "enable-rgba-4444-textures";
+
+// Enable rasterizer that writes directly to GPU memory associated with tiles.
+const char kEnableZeroCopy[] = "enable-zero-copy";
+
+// The number of multisample antialiasing samples for GPU rasterization.
+// Requires MSAA support on GPU to have an effect. 0 disables MSAA.
+const char kGpuRasterizationMSAASampleCount[] =
+ "gpu-rasterization-msaa-sample-count";
+
// Used to communicate managed policy for the IntensiveWakeUpThrottling feature.
// This feature is typically controlled by base::Feature (see
// renderer/platform/scheduler/common/features.*) but requires an enterprise
@@ -22,6 +64,21 @@
extern const char kIntensiveWakeUpThrottlingPolicy_ForceDisable[] = "0";
extern const char kIntensiveWakeUpThrottlingPolicy_ForceEnable[] = "1";
+// Sets the width and height above which a composited layer will get tiled.
+const char kMaxUntiledLayerHeight[] = "max-untiled-layer-height";
+const char kMaxUntiledLayerWidth[] = "max-untiled-layer-width";
+
+// Sets the min tile height for GPU raster.
+const char kMinHeightForGpuRasterTile[] = "min-height-for-gpu-raster-tile";
+
+// Visibly render a border around layout shift rects in the web page to help
+// debug and study layout shifts.
+const char kShowLayoutShiftRegions[] = "show-layout-shift-regions";
+
+// Visibly render a border around paint rects in the web page to help debug
+// and study painting behavior.
+const char kShowPaintRects[] = "show-paint-rects";
+
// Used to communicate managed policy for the UserAgentClientHint feature.
// This feature is typically controlled by base::Feature (see
// renderer/platform/scheduler/common/features.*) but requires an enterprise
@@ -29,5 +86,6 @@
extern const char kUserAgentClientHintDisable[] =
"user-agent-client-hint-disable";
+
} // namespace switches
} // namespace blink
diff --git a/third_party/blink/public/common/switches.h b/third_party/blink/public/common/switches.h
index 4169925..12c6799 100644
--- a/third_party/blink/public/common/switches.h
+++ b/third_party/blink/public/common/switches.h
@@ -15,11 +15,29 @@
// All switches in alphabetical order. The switches should be documented
// alongside the definition of their values in the .cc file.
BLINK_COMMON_EXPORT extern const char kAllowPreCommitInput[];
+BLINK_COMMON_EXPORT extern const char kDefaultTileWidth[];
+BLINK_COMMON_EXPORT extern const char kDefaultTileHeight[];
+BLINK_COMMON_EXPORT extern const char kDisableImageAnimationResync[];
+BLINK_COMMON_EXPORT extern const char kDisableLowResTiling[];
+BLINK_COMMON_EXPORT extern const char kDisablePartialRaster[];
+BLINK_COMMON_EXPORT extern const char kDisableRGBA4444Textures[];
+BLINK_COMMON_EXPORT extern const char kDisableZeroCopy[];
+BLINK_COMMON_EXPORT extern const char
+ kEnableGpuMemoryBufferCompositorResources[];
+BLINK_COMMON_EXPORT extern const char kEnableLowResTiling[];
+BLINK_COMMON_EXPORT extern const char kEnableRGBA4444Textures[];
+BLINK_COMMON_EXPORT extern const char kEnableZeroCopy[];
+BLINK_COMMON_EXPORT extern const char kGpuRasterizationMSAASampleCount[];
BLINK_COMMON_EXPORT extern const char kIntensiveWakeUpThrottlingPolicy[];
BLINK_COMMON_EXPORT extern const char
kIntensiveWakeUpThrottlingPolicy_ForceDisable[];
BLINK_COMMON_EXPORT extern const char
kIntensiveWakeUpThrottlingPolicy_ForceEnable[];
+BLINK_COMMON_EXPORT extern const char kMaxUntiledLayerHeight[];
+BLINK_COMMON_EXPORT extern const char kMaxUntiledLayerWidth[];
+BLINK_COMMON_EXPORT extern const char kMinHeightForGpuRasterTile[];
+BLINK_COMMON_EXPORT extern const char kShowLayoutShiftRegions[];
+BLINK_COMMON_EXPORT extern const char kShowPaintRects[];
BLINK_COMMON_EXPORT extern const char kUserAgentClientHintDisable[];
} // namespace switches