OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * Copyright 2014 Google Inc. | |
3 * | |
4 * Use of this source code is governed by a BSD-style license that can be | |
5 * found in the LICENSE file. | |
6 */ | |
7 | |
8 | |
9 #include "GrCacheable.h" | |
10 | |
11 uint32_t GrCacheable::CreateUniqueID() { | |
12 static int32_t gCacheableID = SK_InvalidUniqueID; | |
13 uint32_t id; | |
14 do { | |
15 id = static_cast<uint32_t>(sk_atomic_inc(&gCacheableID) + 1); | |
16 } while (id == SK_InvalidUniqueID); | |
17 return id; | |
18 } | |
OLD | NEW |