Commit 59e9a996 authored by alexst's avatar alexst Committed by Commit bot

[ozone] Add an about flag to enable ozone overlay testing.

BUG=

Review URL: https://codereview.chromium.org/967733005

Cr-Commit-Position: refs/heads/master@{#318964}
parent bed42845
......@@ -6886,6 +6886,14 @@ Keep your key file in a safe place. You will need it to create new versions of y
<message name="IDS_FLAGS_SYNC_SANDBOX_DESCRIPTION" desc="Description for the flag that causes Chrome to use the sandbox (testing) server for Sync.">
Connects to the testing server for Chrome Sync.
</message>
<if expr="chromeos">
<message name="IDS_FLAGS_OZONE_TEST_SINGLE_HARDWARE_OVERLAY" desc="Name of the 'Ozone hardware overlay' lab.">
Ozone hardware overlay
</message>
<message name="IDS_FLAGS_OZONE_TEST_SINGLE_HARDWARE_OVERLAY_DESCRIPTION" desc="Description of the 'Ozone hardware overlay' lab.">
Enables compositing with an addition of one hardware overlay when possible.
</message>
</if>
<!-- Crashes -->
<message name="IDS_CRASHES_TITLE" desc="Title for the chrome://crashes page.">
......
......@@ -66,6 +66,10 @@
#include "extensions/common/switches.h"
#endif
#if defined(USE_OZONE)
#include "ui/ozone/public/ozone_switches.h"
#endif
namespace about_flags {
// Macros to simplify specifying the type.
......@@ -2185,6 +2189,15 @@ const Experiment kExperiments[] = {
switches::kSyncServiceURL,
"https://chrome-sync.sandbox.google.com/chrome-sync/alpha")
},
#if defined(OS_CHROMEOS) && defined(USE_OZONE)
{
"ozone-test-single-overlay-support",
IDS_FLAGS_OZONE_TEST_SINGLE_HARDWARE_OVERLAY,
IDS_FLAGS_OZONE_TEST_SINGLE_HARDWARE_OVERLAY_DESCRIPTION,
kOsCrOS,
SINGLE_VALUE_TYPE(switches::kOzoneTestSingleOverlaySupport)
},
#endif // defined(OS_CHROMEOS) && defined(USE_OZONE)
// NOTE: Adding new command-line switches requires adding corresponding
// entries to enum "LoginCustomFlags" in histograms.xml. See note in
......
......@@ -50,6 +50,7 @@
#elif defined(USE_OZONE)
#include "content/browser/compositor/overlay_candidate_validator_ozone.h"
#include "content/browser/compositor/software_output_device_ozone.h"
#include "ui/ozone/public/ozone_switches.h"
#include "ui/ozone/public/surface_factory_ozone.h"
#elif defined(USE_X11)
#include "content/browser/compositor/software_output_device_x11.h"
......@@ -121,9 +122,10 @@ scoped_ptr<cc::OverlayCandidateValidator> CreateOverlayCandidateValidator(
#if defined(USE_OZONE)
ui::OverlayCandidatesOzone* overlay_candidates =
ui::SurfaceFactoryOzone::GetInstance()->GetOverlayCandidates(widget);
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
if (overlay_candidates &&
base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableHardwareOverlays)) {
(command_line->HasSwitch(switches::kEnableHardwareOverlays) ||
command_line->HasSwitch(switches::kOzoneTestSingleOverlaySupport))) {
return scoped_ptr<cc::OverlayCandidateValidator>(
new OverlayCandidateValidatorOzone(widget, overlay_candidates));
}
......
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