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

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

Issue 1734043002: Revert of Move Budgeted enum out of SkSurface, use in GrTextureProvider (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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/GrGpu.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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 } 112 }
113 SkASSERT(fUniqueKey.isValid()); 113 SkASSERT(fUniqueKey.isValid());
114 get_resource_cache(fGpu)->resourceAccess().removeUniqueKey(this); 114 get_resource_cache(fGpu)->resourceAccess().removeUniqueKey(this);
115 } 115 }
116 116
117 void GrGpuResource::setUniqueKey(const GrUniqueKey& key) { 117 void GrGpuResource::setUniqueKey(const GrUniqueKey& key) {
118 SkASSERT(this->internalHasRef()); 118 SkASSERT(this->internalHasRef());
119 SkASSERT(key.isValid()); 119 SkASSERT(key.isValid());
120 120
121 // Wrapped and uncached resources can never have a unique key. 121 // Wrapped and uncached resources can never have a unique key.
122 if (SkBudgeted::kNo == this->resourcePriv().isBudgeted()) { 122 if (!this->resourcePriv().isBudgeted()) {
123 return; 123 return;
124 } 124 }
125 125
126 if (this->wasDestroyed()) { 126 if (this->wasDestroyed()) {
127 return; 127 return;
128 } 128 }
129 129
130 get_resource_cache(fGpu)->resourceAccess().changeUniqueKey(this, key); 130 get_resource_cache(fGpu)->resourceAccess().changeUniqueKey(this, key);
131 } 131 }
132 132
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 } 198 }
199 199
200 uint32_t GrGpuResource::CreateUniqueID() { 200 uint32_t GrGpuResource::CreateUniqueID() {
201 static int32_t gUniqueID = SK_InvalidUniqueID; 201 static int32_t gUniqueID = SK_InvalidUniqueID;
202 uint32_t id; 202 uint32_t id;
203 do { 203 do {
204 id = static_cast<uint32_t>(sk_atomic_inc(&gUniqueID) + 1); 204 id = static_cast<uint32_t>(sk_atomic_inc(&gUniqueID) + 1);
205 } while (id == SK_InvalidUniqueID); 205 } while (id == SK_InvalidUniqueID);
206 return id; 206 return id;
207 } 207 }
OLDNEW
« no previous file with comments | « src/gpu/GrGpu.cpp ('k') | src/gpu/GrGpuResourceCacheAccess.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698