Commit 06a16f79 authored by Mohsen Izadi's avatar Mohsen Izadi Committed by Commit Bot

Clean up flag for out-of-process Viz in Mash

Multi-Process Mash by default runs Viz in Ash process. There is a
--enable-viz flag used to run it as a separate process. This CL changes
that flag to a feature named MashOopViz and adds it to chrome://flags
page. When Viz runs properly as a standalone process, we can get rid of
this flag and make it the default behavior for Mash. Then,
--in-process-gpu flag can be used to run Viz in Ash process.

BUG=862384

Change-Id: I3015a0936a7287e7a7106c86bbed55863eabdbbe
Reviewed-on: https://chromium-review.googlesource.com/c/1349478Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Mohsen Izadi <mohsen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611985}
parent c660e93a
...@@ -1693,6 +1693,9 @@ const FeatureEntry kFeatureEntries[] = { ...@@ -1693,6 +1693,9 @@ const FeatureEntry kFeatureEntries[] = {
{"mash", flag_descriptions::kUseMashName, {"mash", flag_descriptions::kUseMashName,
flag_descriptions::kUseMashDescription, kOsCrOS, flag_descriptions::kUseMashDescription, kOsCrOS,
FEATURE_VALUE_TYPE(features::kMash)}, FEATURE_VALUE_TYPE(features::kMash)},
{"mash-oop-viz", flag_descriptions::kMashOopVizName,
flag_descriptions::kMashOopVizDescription, kOsCrOS,
FEATURE_VALUE_TYPE(features::kMashOopViz)},
{"newblue", flag_descriptions::kNewblueName, {"newblue", flag_descriptions::kNewblueName,
flag_descriptions::kNewblueDescription, kOsCrOS, flag_descriptions::kNewblueDescription, kOsCrOS,
FEATURE_VALUE_TYPE(device::kNewblueDaemon)}, FEATURE_VALUE_TYPE(device::kNewblueDaemon)},
......
...@@ -2399,6 +2399,11 @@ ...@@ -2399,6 +2399,11 @@
"owners": [ "mustash-team@google.com" ], "owners": [ "mustash-team@google.com" ],
"expiry_milestone": 79 "expiry_milestone": 79
}, },
{
"name": "mash-oop-viz",
"owners": [ "mustash-team@google.com" ],
"expiry_milestone": 74
},
{ {
"name": "material-design-ink-drop-animation-speed", "name": "material-design-ink-drop-animation-speed",
// "owners": [ "your-team" ], // "owners": [ "your-team" ],
......
...@@ -3470,6 +3470,11 @@ const char kLockScreenNotificationName[] = "Lock screen notification"; ...@@ -3470,6 +3470,11 @@ const char kLockScreenNotificationName[] = "Lock screen notification";
const char kLockScreenNotificationDescription[] = const char kLockScreenNotificationDescription[] =
"Enable notifications on the lock screen."; "Enable notifications on the lock screen.";
const char kMashOopVizName[] = "Out-of-process viz for mash";
const char kMashOopVizDescription[] =
"Runs viz in a separate process when mash is enabled (otherwise viz would "
"run in ash process)";
const char kMaterialDesignInkDropAnimationSpeedName[] = const char kMaterialDesignInkDropAnimationSpeedName[] =
"Material design ink drop animation speed"; "Material design ink drop animation speed";
const char kMaterialDesignInkDropAnimationSpeedDescription[] = const char kMaterialDesignInkDropAnimationSpeedDescription[] =
......
...@@ -2090,6 +2090,9 @@ extern const char kImeServiceDescription[]; ...@@ -2090,6 +2090,9 @@ extern const char kImeServiceDescription[];
extern const char kLockScreenNotificationName[]; extern const char kLockScreenNotificationName[];
extern const char kLockScreenNotificationDescription[]; extern const char kLockScreenNotificationDescription[];
extern const char kMashOopVizName[];
extern const char kMashOopVizDescription[];
extern const char kMaterialDesignInkDropAnimationSpeedName[]; extern const char kMaterialDesignInkDropAnimationSpeedName[];
extern const char kMaterialDesignInkDropAnimationSpeedDescription[]; extern const char kMaterialDesignInkDropAnimationSpeedDescription[];
extern const char kMaterialDesignInkDropAnimationFast[]; extern const char kMaterialDesignInkDropAnimationFast[];
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include "services/viz/privileged/interfaces/viz_main.mojom.h" #include "services/viz/privileged/interfaces/viz_main.mojom.h"
#include "services/viz/public/interfaces/constants.mojom.h" #include "services/viz/public/interfaces/constants.mojom.h"
#include "services/ws/gpu_host/gpu_host_delegate.h" #include "services/ws/gpu_host/gpu_host_delegate.h"
#include "ui/base/ui_base_features.h"
#include "ui/gfx/buffer_format_util.h" #include "ui/gfx/buffer_format_util.h"
#if defined(OS_WIN) #if defined(OS_WIN)
...@@ -44,12 +45,6 @@ namespace { ...@@ -44,12 +45,6 @@ namespace {
// The client Id 1 is reserved for the frame sink manager. // The client Id 1 is reserved for the frame sink manager.
const int32_t kInternalGpuChannelClientId = 2; const int32_t kInternalGpuChannelClientId = 2;
// TODO(crbug.com/620927): This should be removed once ozone-mojo is done.
bool HasSplitVizProcess() {
constexpr char kEnableViz[] = "enable-viz";
return base::CommandLine::ForCurrentProcess()->HasSwitch(kEnableViz);
}
class GpuClientDelegate : public viz::GpuClientDelegate { class GpuClientDelegate : public viz::GpuClientDelegate {
public: public:
GpuClientDelegate(viz::GpuHostImpl* gpu_host_impl, GpuClientDelegate(viz::GpuHostImpl* gpu_host_impl,
...@@ -100,7 +95,7 @@ GpuHost::GpuHost(GpuHostDelegate* delegate, ...@@ -100,7 +95,7 @@ GpuHost::GpuHost(GpuHostDelegate* delegate,
viz::GpuHostImpl::InitFontRenderParams( viz::GpuHostImpl::InitFontRenderParams(
gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(), nullptr)); gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(), nullptr));
bool in_process = !connector || !HasSplitVizProcess(); bool in_process = !connector || !features::IsMashOopVizEnabled();
viz::mojom::VizMainPtr viz_main_ptr; viz::mojom::VizMainPtr viz_main_ptr;
if (in_process) { if (in_process) {
......
...@@ -30051,6 +30051,7 @@ from previous Chrome versions. ...@@ -30051,6 +30051,7 @@ from previous Chrome versions.
label="AutofillSaveCardDialogUnlabeledExpirationDate:disabled"/> label="AutofillSaveCardDialogUnlabeledExpirationDate:disabled"/>
<int value="-697751423" label="disable-quickoffice-component-app"/> <int value="-697751423" label="disable-quickoffice-component-app"/>
<int value="-696693295" label="Canvas2DImageChromium:disabled"/> <int value="-696693295" label="Canvas2DImageChromium:disabled"/>
<int value="-694187898" label="MashOopViz:disabled"/>
<int value="-684900739" label="disable-merge-key-char-events"/> <int value="-684900739" label="disable-merge-key-char-events"/>
<int value="-684223908" label="enable-android-wallpapers-app"/> <int value="-684223908" label="enable-android-wallpapers-app"/>
<int value="-683370370" label="EnableAppDataSearch:enabled"/> <int value="-683370370" label="EnableAppDataSearch:enabled"/>
...@@ -31285,6 +31286,7 @@ from previous Chrome versions. ...@@ -31285,6 +31286,7 @@ from previous Chrome versions.
<int value="1614596813" label="CloseButtonsInactiveTabs:disabled"/> <int value="1614596813" label="CloseButtonsInactiveTabs:disabled"/>
<int value="1615988672" label="GrantNotificationsToDSE:enabled"/> <int value="1615988672" label="GrantNotificationsToDSE:enabled"/>
<int value="1617187093" label="enable-improved-a2hs"/> <int value="1617187093" label="enable-improved-a2hs"/>
<int value="1618633341" label="MashOopViz:enabled"/>
<int value="1621298798" label="VrBrowserKeyboard:enabled"/> <int value="1621298798" label="VrBrowserKeyboard:enabled"/>
<int value="1622131033" label="ozone-test-single-overlay-support"/> <int value="1622131033" label="ozone-test-single-overlay-support"/>
<int value="1626824478" label="ExperimentalAppBanners:disabled"/> <int value="1626824478" label="ExperimentalAppBanners:disabled"/>
...@@ -143,6 +143,9 @@ const base::Feature kDirectManipulationStylus = { ...@@ -143,6 +143,9 @@ const base::Feature kDirectManipulationStylus = {
const base::Feature kMash = {"Mash", base::FEATURE_DISABLED_BY_DEFAULT}; const base::Feature kMash = {"Mash", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kMashOopViz = {"MashOopViz",
base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kSingleProcessMash = {"SingleProcessMash", const base::Feature kSingleProcessMash = {"SingleProcessMash",
base::FEATURE_DISABLED_BY_DEFAULT}; base::FEATURE_DISABLED_BY_DEFAULT};
...@@ -154,6 +157,10 @@ bool IsMultiProcessMash() { ...@@ -154,6 +157,10 @@ bool IsMultiProcessMash() {
return base::FeatureList::IsEnabled(features::kMash); return base::FeatureList::IsEnabled(features::kMash);
} }
bool IsMashOopVizEnabled() {
return base::FeatureList::IsEnabled(features::kMashOopViz);
}
bool IsSingleProcessMash() { bool IsSingleProcessMash() {
return base::FeatureList::IsEnabled(features::kSingleProcessMash); return base::FeatureList::IsEnabled(features::kSingleProcessMash);
} }
......
...@@ -57,6 +57,12 @@ UI_BASE_EXPORT extern const base::Feature kDirectManipulationStylus; ...@@ -57,6 +57,12 @@ UI_BASE_EXPORT extern const base::Feature kDirectManipulationStylus;
// TODO(jamescook): Make flag only available in Chrome OS. // TODO(jamescook): Make flag only available in Chrome OS.
UI_BASE_EXPORT extern const base::Feature kMash; UI_BASE_EXPORT extern const base::Feature kMash;
// Used to run Viz in its own process when kMash is enabled. Viz is run in Ash
// process by default.
// TODO(mohsen): Remove this when Viz can run fully in a separate process. Then
// make it the default kMash behavior.
UI_BASE_EXPORT extern const base::Feature kMashOopViz;
UI_BASE_EXPORT extern const base::Feature kSingleProcessMash; UI_BASE_EXPORT extern const base::Feature kSingleProcessMash;
// Returns true if Chrome's aura usage is backed by the WindowService. // Returns true if Chrome's aura usage is backed by the WindowService.
...@@ -66,6 +72,8 @@ UI_BASE_EXPORT bool IsUsingWindowService(); ...@@ -66,6 +72,8 @@ UI_BASE_EXPORT bool IsUsingWindowService();
// service and Viz graphics). See //ash/README.md. // service and Viz graphics). See //ash/README.md.
UI_BASE_EXPORT bool IsMultiProcessMash(); UI_BASE_EXPORT bool IsMultiProcessMash();
UI_BASE_EXPORT bool IsMashOopVizEnabled();
// Returns true if code outside of ash is using the WindowService. In this mode // Returns true if code outside of ash is using the WindowService. In this mode
// there are two aura::Envs. Ash uses one with Env::Mode::LOCAL. Non-ash code // there are two aura::Envs. Ash uses one with Env::Mode::LOCAL. Non-ash code
// uses an aura::Env with a mode of MUS. The non-ash code using mus targets the // uses an aura::Env with a mode of MUS. The non-ash code using mus targets the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment