summaryrefslogtreecommitdiff
path: root/chromium/components/viz/common/surfaces/surface_sequence_generator.h
blob: 1bed7d5baf7e6425b6f317bfa5c915c489d19464 (plain)
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
36
37
38
39
40
41
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_VIZ_COMMON_SURFACES_SURFACE_SEQUENCE_GENERATOR_H_
#define COMPONENTS_VIZ_COMMON_SURFACES_SURFACE_SEQUENCE_GENERATOR_H_

#include <stdint.h>

#include <tuple>

#include "base/macros.h"

#include "components/viz/common/surfaces/frame_sink_id.h"
#include "components/viz/common/surfaces/surface_sequence.h"
#include "components/viz/common/viz_common_export.h"

namespace viz {

// Generates unique surface sequences for a surface client id.
class VIZ_COMMON_EXPORT SurfaceSequenceGenerator {
 public:
  SurfaceSequenceGenerator();
  ~SurfaceSequenceGenerator();

  void set_frame_sink_id(const FrameSinkId& frame_sink_id) {
    frame_sink_id_ = frame_sink_id;
  }

  SurfaceSequence CreateSurfaceSequence();

 private:
  FrameSinkId frame_sink_id_;
  uint32_t next_surface_sequence_;

  DISALLOW_COPY_AND_ASSIGN(SurfaceSequenceGenerator);
};

}  // namespace viz

#endif  // COMPONENTS_VIZ_COMMON_SURFACES_SURFACE_SEQUENCE_GENERATOR_H_