chromium/cc/metrics/compositor_timing_history.cc

// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#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 {

// Used to generate a unique id when emitting the "Long Draw Interval" trace
// event.
int g_num_long_draw_intervals =;

// The threshold to emit a trace event is the 99th percentile
// of the histogram on Windows Stable as of Feb 26th, 2020.
constexpr base::TimeDelta kDrawIntervalTraceThreshold =;

// Using the 90th percentile will disable latency recovery
// if we are missing the deadline approximately ~6 times per
// second.
// TODO(brianderson): Fine tune the percentiles below.
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 =;

// ~90 VSync aligned UMA buckets.
const int kUMAVSyncBuckets[] =;

#define UMA_HISTOGRAM_CUSTOM_TIMES_VSYNC_ALIGNED(name, sample)

}  // namespace

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 {}
}  // namespace cc