#include "components/viz/service/display/frame_rate_decider.h"
#include <algorithm>
#include <utility>
#include "base/metrics/histogram_macros.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
#include "components/viz/common/constants.h"
#include "components/viz/common/features.h"
#include "components/viz/common/frame_sinks/begin_frame_args.h"
#include "components/viz/service/surfaces/surface.h"
#include "components/viz/service/surfaces/surface_manager.h"
#include "media/filters/video_cadence_estimator.h"
namespace viz {
namespace {
constexpr size_t kMinNumOfFramesToToggleInterval = …;
bool AreAlmostEqual(base::TimeDelta a, base::TimeDelta b) { … }
}
FrameRateDecider::ScopedAggregate::ScopedAggregate(FrameRateDecider* decider)
: … { … }
FrameRateDecider::ScopedAggregate::~ScopedAggregate() { … }
FrameRateDecider::FrameRateDecider(SurfaceManager* surface_manager,
Client* client,
bool hw_support_for_multiple_refresh_rates,
bool output_surface_supports_set_frame_rate)
: … { … }
FrameRateDecider::~FrameRateDecider() { … }
void FrameRateDecider::SetSupportedFrameIntervals(
base::flat_set<base::TimeDelta> supported_intervals) { … }
void FrameRateDecider::OnSurfaceWillBeDrawn(Surface* surface) { … }
void FrameRateDecider::StartAggregation() { … }
void FrameRateDecider::EndAggregation() { … }
void FrameRateDecider::UpdatePreferredFrameIntervalIfNeeded() { … }
ToggleFrameRateCase FrameRateDecider::GetToggleFrameRateCase(
const std::vector<base::TimeDelta>& fixed_interval_frame_sink_intervals)
const { … }
void FrameRateDecider::SetPreferredInterval(
base::TimeDelta new_preferred_interval) { … }
bool FrameRateDecider::multiple_refresh_rates_supported() const { … }
void FrameRateDecider::SetHwSupportForMultipleRefreshRates(bool support) { … }
}