#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "cc/metrics/compositor_timing_history.h"
#include <stddef.h>
#include <stdint.h>
#include <algorithm>
#include <utility>
#include <vector>
#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
#include "base/notreached.h"
#include "base/trace_event/trace_event.h"
#include "cc/debug/rendering_stats_instrumentation.h"
namespace cc {
namespace {
int g_num_long_draw_intervals = …;
constexpr base::TimeDelta kDrawIntervalTraceThreshold = …;
const size_t kDurationHistorySize = …;
const double kBeginMainFrameQueueDurationEstimationPercentile = …;
const double kBeginMainFrameQueueDurationCriticalEstimationPercentile = …;
const double kBeginMainFrameQueueDurationNotCriticalEstimationPercentile = …;
const double kBeginMainFrameStartToReadyToCommitEstimationPercentile = …;
const double kCommitEstimatePercentile = …;
const double kCommitToReadyToActivateEstimationPercentile = …;
const double kActivateEstimationPercentile = …;
const double kDrawEstimationPercentile = …;
const int kUMAVSyncBuckets[] = …;
#define UMA_HISTOGRAM_CUSTOM_TIMES_VSYNC_ALIGNED(name, sample) …
}
CompositorTimingHistory::CompositorTimingHistory(
UMACategory uma_category,
RenderingStatsInstrumentation* rendering_stats_instrumentation)
: … { … }
CompositorTimingHistory::~CompositorTimingHistory() = default;
base::TimeTicks CompositorTimingHistory::Now() const { … }
void CompositorTimingHistory::SetRecordingEnabled(bool enabled) { … }
void CompositorTimingHistory::SetCompositorDrawingContinuously(bool active) { … }
base::TimeDelta
CompositorTimingHistory::BeginMainFrameQueueDurationCriticalEstimate() const { … }
base::TimeDelta
CompositorTimingHistory::BeginMainFrameQueueDurationNotCriticalEstimate()
const { … }
base::TimeDelta
CompositorTimingHistory::BeginMainFrameStartToReadyToCommitDurationEstimate()
const { … }
base::TimeDelta CompositorTimingHistory::CommitDurationEstimate() const { … }
base::TimeDelta
CompositorTimingHistory::CommitToReadyToActivateDurationEstimate() const { … }
base::TimeDelta CompositorTimingHistory::ActivateDurationEstimate() const { … }
base::TimeDelta CompositorTimingHistory::DrawDurationEstimate() const { … }
base::TimeDelta
CompositorTimingHistory::BeginMainFrameStartToReadyToCommitCriticalEstimate()
const { … }
base::TimeDelta
CompositorTimingHistory::BeginMainFrameStartToReadyToCommitNotCriticalEstimate()
const { … }
base::TimeDelta
CompositorTimingHistory::BeginMainFrameQueueToActivateCriticalEstimate() const { … }
void CompositorTimingHistory::WillFinishImplFrame(bool needs_redraw) { … }
void CompositorTimingHistory::BeginImplFrameNotExpectedSoon() { … }
void CompositorTimingHistory::WillBeginMainFrame(
const viz::BeginFrameArgs& args) { … }
void CompositorTimingHistory::BeginMainFrameStarted(
base::TimeTicks main_thread_start_time) { … }
void CompositorTimingHistory::BeginMainFrameAborted() { … }
void CompositorTimingHistory::NotifyReadyToCommit() { … }
void CompositorTimingHistory::WillCommit() { … }
void CompositorTimingHistory::DidCommit() { … }
void CompositorTimingHistory::DidBeginMainFrame(
base::TimeTicks begin_main_frame_end_time) { … }
void CompositorTimingHistory::WillInvalidateOnImplSide() { … }
void CompositorTimingHistory::ReadyToActivate() { … }
void CompositorTimingHistory::WillActivate() { … }
void CompositorTimingHistory::DidActivate() { … }
void CompositorTimingHistory::WillDraw() { … }
void CompositorTimingHistory::DidDraw() { … }
void CompositorTimingHistory::ClearHistory() { … }
size_t CompositorTimingHistory::CommitDurationSampleCountForTesting() const { … }
}