OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "GrGpuResource.h" | 9 #include "GrGpuResource.h" |
| 10 #include "GrContext.h" |
10 #include "GrResourceCache.h" | 11 #include "GrResourceCache.h" |
11 #include "GrGpu.h" | 12 #include "GrGpu.h" |
12 #include "GrGpuResourcePriv.h" | 13 #include "GrGpuResourcePriv.h" |
13 | 14 |
14 static inline GrResourceCache* get_resource_cache(GrGpu* gpu) { | 15 static inline GrResourceCache* get_resource_cache(GrGpu* gpu) { |
15 SkASSERT(gpu); | 16 SkASSERT(gpu); |
16 SkASSERT(gpu->getContext()); | 17 SkASSERT(gpu->getContext()); |
17 SkASSERT(gpu->getContext()->getResourceCache()); | 18 SkASSERT(gpu->getContext()->getResourceCache()); |
18 return gpu->getContext()->getResourceCache(); | 19 return gpu->getContext()->getResourceCache(); |
19 } | 20 } |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 } | 173 } |
173 | 174 |
174 uint32_t GrGpuResource::CreateUniqueID() { | 175 uint32_t GrGpuResource::CreateUniqueID() { |
175 static int32_t gUniqueID = SK_InvalidUniqueID; | 176 static int32_t gUniqueID = SK_InvalidUniqueID; |
176 uint32_t id; | 177 uint32_t id; |
177 do { | 178 do { |
178 id = static_cast<uint32_t>(sk_atomic_inc(&gUniqueID) + 1); | 179 id = static_cast<uint32_t>(sk_atomic_inc(&gUniqueID) + 1); |
179 } while (id == SK_InvalidUniqueID); | 180 } while (id == SK_InvalidUniqueID); |
180 return id; | 181 return id; |
181 } | 182 } |
OLD | NEW |