summaryrefslogtreecommitdiffstats
path: root/cc/animation/animation_id_provider.cc
blob: 9c87d2049f4fe622264842eef9d95a781f92509d (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
// Copyright (c) 2013 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.

#include "base/atomic_sequence_num.h"
#include "cc/animation/animation_id_provider.h"

namespace cc {

base::StaticAtomicSequenceNumber g_next_animation_id;
base::StaticAtomicSequenceNumber g_next_group_id;
base::StaticAtomicSequenceNumber g_next_timeline_id;
base::StaticAtomicSequenceNumber g_next_player_id;

int AnimationIdProvider::NextAnimationId() {
  // Animation IDs start from 1.
  return g_next_animation_id.GetNext() + 1;
}

int AnimationIdProvider::NextGroupId() {
  // Animation group IDs start from 1.
  return g_next_group_id.GetNext() + 1;
}

int AnimationIdProvider::NextTimelineId() {
  return g_next_timeline_id.GetNext() + 1;
}

int AnimationIdProvider::NextPlayerId() {
  return g_next_player_id.GetNext() + 1;
}

}  // namespace cc