| 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 | 9 |
| 10 #include "GrGpuResource.h" | 10 #include "GrGpuResource.h" |
| 11 #include "GrResourceCache2.h" | 11 #include "GrResourceCache2.h" |
| 12 #include "GrGpu.h" | 12 #include "GrGpu.h" |
| 13 | 13 |
| 14 GrGpuRef::~GrGpuRef() { | 14 GrIORef::~GrIORef() { |
| 15 SkASSERT(0 == fRefCnt); | 15 SkASSERT(0 == fRefCnt); |
| 16 SkASSERT(0 == fPendingReads); | 16 SkASSERT(0 == fPendingReads); |
| 17 SkASSERT(0 == fPendingWrites); | 17 SkASSERT(0 == fPendingWrites); |
| 18 // Set to invalid values. | 18 // Set to invalid values. |
| 19 SkDEBUGCODE(fRefCnt = fPendingReads = fPendingWrites = -10;) | 19 SkDEBUGCODE(fRefCnt = fPendingReads = fPendingWrites = -10;) |
| 20 } | 20 } |
| 21 | 21 |
| 22 /////////////////////////////////////////////////////////////////////////////// | 22 /////////////////////////////////////////////////////////////////////////////// |
| 23 | 23 |
| 24 static inline GrResourceCache2* get_resource_cache2(GrGpu* gpu) { | 24 static inline GrResourceCache2* get_resource_cache2(GrGpu* gpu) { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 } | 89 } |
| 90 | 90 |
| 91 uint32_t GrGpuResource::CreateUniqueID() { | 91 uint32_t GrGpuResource::CreateUniqueID() { |
| 92 static int32_t gUniqueID = SK_InvalidUniqueID; | 92 static int32_t gUniqueID = SK_InvalidUniqueID; |
| 93 uint32_t id; | 93 uint32_t id; |
| 94 do { | 94 do { |
| 95 id = static_cast<uint32_t>(sk_atomic_inc(&gUniqueID) + 1); | 95 id = static_cast<uint32_t>(sk_atomic_inc(&gUniqueID) + 1); |
| 96 } while (id == SK_InvalidUniqueID); | 96 } while (id == SK_InvalidUniqueID); |
| 97 return id; | 97 return id; |
| 98 } | 98 } |
| OLD | NEW |