1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35

cc / slim / simple_scheduler.h [blame]

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

#ifndef CC_SLIM_SIMPLE_SCHEDULER_H_
#define CC_SLIM_SIMPLE_SCHEDULER_H_

#include "base/component_export.h"
#include "base/memory/raw_ptr.h"
#include "cc/slim/scheduler.h"

namespace cc::slim {

// Simplest scheduler implementation where it tries to produce immediately in
// OnBeginFrameFromViz and send DidNotProduceFrame immediately.
class COMPONENT_EXPORT(CC_SLIM) SimpleScheduler : public Scheduler {
 public:
  SimpleScheduler();
  ~SimpleScheduler() override;

  void Initialize(SchedulerClient* client) override;
  void OnBeginFrameFromViz(
      const viz::BeginFrameArgs& begin_frame_args) override;
  void OnBeginFramePausedChanged(bool paused) override {}
  void SetNeedsBeginFrame(bool needs_begin_frame) override {}
  void SetIsSwapThrottled(bool is_swap_throttled) override {}
  void MaybeCompositeNow() override {}

 private:
  raw_ptr<SchedulerClient> client_ = nullptr;
};

}  // namespace cc::slim

#endif  // CC_SLIM_SIMPLE_SCHEDULER_H_