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

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

Issue 1694943002: When a surface is backed by an external render target force a copy on image snap (Closed) Base URL: https://skia.googlesource.com/skia.git@imgcopy
Patch Set: test git config branch.nollvm.skip-deps-uploads True 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 | « no previous file | 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 162
163 // There is no need to call our notifyAllCntsAreZero function at this point since we already 163 // There is no need to call our notifyAllCntsAreZero function at this point since we already
164 // told the cache about the state of cnts. 164 // told the cache about the state of cnts.
165 return false; 165 return false;
166 } 166 }
167 167
168 void GrGpuResource::setScratchKey(const GrScratchKey& scratchKey) { 168 void GrGpuResource::setScratchKey(const GrScratchKey& scratchKey) {
169 SkASSERT(!fScratchKey.isValid()); 169 SkASSERT(!fScratchKey.isValid());
170 SkASSERT(scratchKey.isValid()); 170 SkASSERT(scratchKey.isValid());
171 // Wrapped resources can never have a scratch key. 171 // Wrapped resources can never have a scratch key.
172 if (this->cacheAccess().isExternal()) { 172 if (this->resourcePriv().isExternal()) {
173 return; 173 return;
174 } 174 }
175 fScratchKey = scratchKey; 175 fScratchKey = scratchKey;
176 } 176 }
177 177
178 void GrGpuResource::removeScratchKey() { 178 void GrGpuResource::removeScratchKey() {
179 if (!this->wasDestroyed() && fScratchKey.isValid()) { 179 if (!this->wasDestroyed() && fScratchKey.isValid()) {
180 get_resource_cache(fGpu)->resourceAccess().willRemoveScratchKey(this); 180 get_resource_cache(fGpu)->resourceAccess().willRemoveScratchKey(this);
181 fScratchKey.reset(); 181 fScratchKey.reset();
182 } 182 }
(...skipping 15 matching lines...) Expand all
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 | « no previous file | src/gpu/GrGpuResourceCacheAccess.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698