Commit 40fe2b90 authored by Shawn Gallea's avatar Shawn Gallea Committed by Commit Bot

Allow 4hz framerate on headless devices

Allows 4hz framerate on headless devices with kReduceHeadlessFrameRate
feature

Bug: b/139299756
Test: Compile cast_shell for headless device
Change-Id: I13a36cbc2225c20367188375518b34baf585f2df
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1815049
Commit-Queue: Shawn Gallea <sagallea@google.com>
Reviewed-by: default avatarMichael Spang <spang@chromium.org>
Reviewed-by: default avatarSunny Sachanandani <sunnyps@chromium.org>
Cr-Commit-Position: refs/heads/master@{#706035}
parent 582e23bf
...@@ -158,6 +158,10 @@ const base::Feature kUseQueryableDataBackend{"use_queryable_data_backend", ...@@ -158,6 +158,10 @@ const base::Feature kUseQueryableDataBackend{"use_queryable_data_backend",
const base::Feature kEnableSideGesturePassThrough{ const base::Feature kEnableSideGesturePassThrough{
"enable_side_gesture_pass_through", base::FEATURE_DISABLED_BY_DEFAULT}; "enable_side_gesture_pass_through", base::FEATURE_DISABLED_BY_DEFAULT};
// Lowers frame rate for headless
const base::Feature kReduceHeadlessFrameRate{"reduce_headless_frame_rate",
base::FEATURE_DISABLED_BY_DEFAULT};
// End Chromecast Feature definitions. // End Chromecast Feature definitions.
const base::Feature* kFeatures[] = { const base::Feature* kFeatures[] = {
&kAllowUserMediaAccess, &kAllowUserMediaAccess,
...@@ -168,6 +172,7 @@ const base::Feature* kFeatures[] = { ...@@ -168,6 +172,7 @@ const base::Feature* kFeatures[] = {
&kEnableGeneralAudienceBrowsing, &kEnableGeneralAudienceBrowsing,
&kUseQueryableDataBackend, &kUseQueryableDataBackend,
&kEnableSideGesturePassThrough, &kEnableSideGesturePassThrough,
&kReduceHeadlessFrameRate,
}; };
// An iterator for a base::DictionaryValue. Use an alias for brevity in loops. // An iterator for a base::DictionaryValue. Use an alias for brevity in loops.
......
...@@ -31,6 +31,7 @@ extern const base::Feature kDisableIdleSocketsCloseOnMemoryPressure; ...@@ -31,6 +31,7 @@ extern const base::Feature kDisableIdleSocketsCloseOnMemoryPressure;
extern const base::Feature kEnableGeneralAudienceBrowsing; extern const base::Feature kEnableGeneralAudienceBrowsing;
extern const base::Feature kUseQueryableDataBackend; extern const base::Feature kUseQueryableDataBackend;
extern const base::Feature kEnableSideGesturePassThrough; extern const base::Feature kEnableSideGesturePassThrough;
extern const base::Feature kReduceHeadlessFrameRate;
// Get an iterable list of all of the cast features for checking all features as // Get an iterable list of all of the cast features for checking all features as
// a collection. // a collection.
......
...@@ -69,6 +69,7 @@ cast_source_set("graphics") { ...@@ -69,6 +69,7 @@ cast_source_set("graphics") {
] ]
deps += [ deps += [
"//chromecast:chromecast_buildflags",
"//components/viz/common", "//components/viz/common",
"//ui/base/ime/init", "//ui/base/ime/init",
"//ui/events:gesture_detection", "//ui/events:gesture_detection",
......
...@@ -4,9 +4,11 @@ ...@@ -4,9 +4,11 @@
#include "chromecast/graphics/cast_window_manager_aura.h" #include "chromecast/graphics/cast_window_manager_aura.h"
#include "base/feature_list.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "chromecast/base/cast_features.h" #include "chromecast/base/cast_features.h"
#include "chromecast/chromecast_buildflags.h"
#include "chromecast/graphics/cast_focus_client_aura.h" #include "chromecast/graphics/cast_focus_client_aura.h"
#include "chromecast/graphics/cast_touch_activity_observer.h" #include "chromecast/graphics/cast_touch_activity_observer.h"
#include "chromecast/graphics/cast_touch_event_gate.h" #include "chromecast/graphics/cast_touch_event_gate.h"
...@@ -254,6 +256,14 @@ void CastWindowManagerAura::Setup() { ...@@ -254,6 +256,14 @@ void CastWindowManagerAura::Setup() {
side_swipe_detector_ = std::make_unique<SideSwipeDetector>( side_swipe_detector_ = std::make_unique<SideSwipeDetector>(
system_gesture_dispatcher_.get(), root_window); system_gesture_dispatcher_.get(), root_window);
} }
#if BUILDFLAG(IS_CAST_AUDIO_ONLY)
if (base::FeatureList::IsEnabled(kReduceHeadlessFrameRate)) {
ui::Compositor* compositor = window_tree_host_->compositor();
compositor->SetDisplayVSyncParameters(
base::TimeTicks(), base::TimeDelta::FromMilliseconds(250));
}
#endif
} }
void CastWindowManagerAura::OnWindowOrderChanged( void CastWindowManagerAura::OnWindowOrderChanged(
......
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