blob: 120be78f0802c69bc26f32d10e038405e656709c [file] [log] [blame]
bsalomon8b2fac42014-06-19 14:13:45 -07001/*
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
11uint32_t GrCacheable::getGenerationID() const {
12 static int32_t gPathRefGenerationID;
13 while (!fGenID) {
14 fGenID = static_cast<uint32_t>(sk_atomic_inc(&gPathRefGenerationID) + 1);
15 }
16 return fGenID;
17}