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

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

Issue 693843004: Remove bogus assert (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month 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 | « no previous file | 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"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 73
74 GrContext* GrGpuResource::getContext() { 74 GrContext* GrGpuResource::getContext() {
75 if (fGpu) { 75 if (fGpu) {
76 return fGpu->getContext(); 76 return fGpu->getContext();
77 } else { 77 } else {
78 return NULL; 78 return NULL;
79 } 79 }
80 } 80 }
81 81
82 bool GrGpuResource::setContentKey(const GrResourceKey& contentKey) { 82 bool GrGpuResource::setContentKey(const GrResourceKey& contentKey) {
83 // Currently this can only be called once and can't be called when the resou rce is scratch.
83 SkASSERT(!contentKey.isScratch()); 84 SkASSERT(!contentKey.isScratch());
84 // Currently this can only be called once and can't be called when the resou rce is scratch.
85 SkASSERT(this->internalHasRef()); 85 SkASSERT(this->internalHasRef());
86 SkASSERT(!this->internalHasPendingIO());
87 86
88 if (fContentKeySet) { 87 if (fContentKeySet) {
89 return false; 88 return false;
90 } 89 }
91 90
92 fContentKey = contentKey; 91 fContentKey = contentKey;
93 fContentKeySet = true; 92 fContentKeySet = true;
94 93
95 if (!get_resource_cache2(fGpu)->didSetContentKey(this)) { 94 if (!get_resource_cache2(fGpu)->didSetContentKey(this)) {
96 fContentKeySet = false; 95 fContentKeySet = false;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 } 130 }
132 131
133 uint32_t GrGpuResource::CreateUniqueID() { 132 uint32_t GrGpuResource::CreateUniqueID() {
134 static int32_t gUniqueID = SK_InvalidUniqueID; 133 static int32_t gUniqueID = SK_InvalidUniqueID;
135 uint32_t id; 134 uint32_t id;
136 do { 135 do {
137 id = static_cast<uint32_t>(sk_atomic_inc(&gUniqueID) + 1); 136 id = static_cast<uint32_t>(sk_atomic_inc(&gUniqueID) + 1);
138 } while (id == SK_InvalidUniqueID); 137 } while (id == SK_InvalidUniqueID);
139 return id; 138 return id;
140 } 139 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698