Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: src/gpu/GrGpuResource.cpp

Issue 638003003: Remove ~GrIORef since last remaining virtual and now all inline (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: save the cpp file this time Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/gpu/GrGpuResource.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 template<typename D> GrIORef<D>::~GrIORef() {
15 SkASSERT(0 == fRefCnt);
16 SkASSERT(0 == fPendingReads);
17 SkASSERT(0 == fPendingWrites);
18 // Set to invalid values.
19 SkDEBUGCODE(fRefCnt = fPendingReads = fPendingWrites = -10;)
20 }
21
22 ///////////////////////////////////////////////////////////////////////////////
23
24 static inline GrResourceCache2* get_resource_cache2(GrGpu* gpu) { 14 static inline GrResourceCache2* get_resource_cache2(GrGpu* gpu) {
25 SkASSERT(gpu); 15 SkASSERT(gpu);
26 SkASSERT(gpu->getContext()); 16 SkASSERT(gpu->getContext());
27 SkASSERT(gpu->getContext()->getResourceCache2()); 17 SkASSERT(gpu->getContext()->getResourceCache2());
28 return gpu->getContext()->getResourceCache2(); 18 return gpu->getContext()->getResourceCache2();
29 } 19 }
30 20
31 static inline GrResourceCache* get_resource_cache(GrGpu* gpu) { 21 static inline GrResourceCache* get_resource_cache(GrGpu* gpu) {
32 SkASSERT(gpu); 22 SkASSERT(gpu);
33 SkASSERT(gpu->getContext()); 23 SkASSERT(gpu->getContext());
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 } 99 }
110 100
111 uint32_t GrGpuResource::CreateUniqueID() { 101 uint32_t GrGpuResource::CreateUniqueID() {
112 static int32_t gUniqueID = SK_InvalidUniqueID; 102 static int32_t gUniqueID = SK_InvalidUniqueID;
113 uint32_t id; 103 uint32_t id;
114 do { 104 do {
115 id = static_cast<uint32_t>(sk_atomic_inc(&gUniqueID) + 1); 105 id = static_cast<uint32_t>(sk_atomic_inc(&gUniqueID) + 1);
116 } while (id == SK_InvalidUniqueID); 106 } while (id == SK_InvalidUniqueID);
117 return id; 107 return id;
118 } 108 }
OLDNEW
« no previous file with comments | « include/gpu/GrGpuResource.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698