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

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

Issue 1316123003: Style Change: SkNEW->new; SkDELETE->delete (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-26 (Wednesday) 15:59:00 EDT Created 5 years, 3 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 | « src/gpu/GrFontScaler.cpp ('k') | src/gpu/GrGpuResourceCacheAccess.h » ('j') | 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 #include "GrGpuResource.h" 9 #include "GrGpuResource.h"
10 #include "GrContext.h" 10 #include "GrContext.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 if (this->wasDestroyed()) { 102 if (this->wasDestroyed()) {
103 return; 103 return;
104 } 104 }
105 105
106 get_resource_cache(fGpu)->resourceAccess().changeUniqueKey(this, key); 106 get_resource_cache(fGpu)->resourceAccess().changeUniqueKey(this, key);
107 } 107 }
108 108
109 void GrGpuResource::notifyAllCntsAreZero(CntType lastCntTypeToReachZero) const { 109 void GrGpuResource::notifyAllCntsAreZero(CntType lastCntTypeToReachZero) const {
110 if (this->wasDestroyed()) { 110 if (this->wasDestroyed()) {
111 // We've already been removed from the cache. Goodbye cruel world! 111 // We've already been removed from the cache. Goodbye cruel world!
112 SkDELETE(this); 112 delete this;
113 return; 113 return;
114 } 114 }
115 115
116 // We should have already handled this fully in notifyRefCntIsZero(). 116 // We should have already handled this fully in notifyRefCntIsZero().
117 SkASSERT(kRef_CntType != lastCntTypeToReachZero); 117 SkASSERT(kRef_CntType != lastCntTypeToReachZero);
118 118
119 GrGpuResource* mutableThis = const_cast<GrGpuResource*>(this); 119 GrGpuResource* mutableThis = const_cast<GrGpuResource*>(this);
120 static const uint32_t kFlag = 120 static const uint32_t kFlag =
121 GrResourceCache::ResourceAccess::kAllCntsReachedZero_RefNotificationFlag ; 121 GrResourceCache::ResourceAccess::kAllCntsReachedZero_RefNotificationFlag ;
122 get_resource_cache(fGpu)->resourceAccess().notifyCntReachedZero(mutableThis, kFlag); 122 get_resource_cache(fGpu)->resourceAccess().notifyCntReachedZero(mutableThis, kFlag);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 } 173 }
174 174
175 uint32_t GrGpuResource::CreateUniqueID() { 175 uint32_t GrGpuResource::CreateUniqueID() {
176 static int32_t gUniqueID = SK_InvalidUniqueID; 176 static int32_t gUniqueID = SK_InvalidUniqueID;
177 uint32_t id; 177 uint32_t id;
178 do { 178 do {
179 id = static_cast<uint32_t>(sk_atomic_inc(&gUniqueID) + 1); 179 id = static_cast<uint32_t>(sk_atomic_inc(&gUniqueID) + 1);
180 } while (id == SK_InvalidUniqueID); 180 } while (id == SK_InvalidUniqueID);
181 return id; 181 return id;
182 } 182 }
OLDNEW
« no previous file with comments | « src/gpu/GrFontScaler.cpp ('k') | src/gpu/GrGpuResourceCacheAccess.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698