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

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

Issue 642493003: Revert of Use presence of a content key as non-scratch indicator (Closed) Base URL: https://skia.googlesource.com/skia.git@pp
Patch Set: 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 | « src/gpu/GrContext.cpp ('k') | src/gpu/GrResourceCache.cpp » ('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 9
10 #include "GrGpuResource.h" 10 #include "GrGpuResource.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 } 94 }
95 } 95 }
96 96
97 void GrGpuResource::setScratchKey(const GrResourceKey& scratchKey) { 97 void GrGpuResource::setScratchKey(const GrResourceKey& scratchKey) {
98 SkASSERT(fScratchKey.isNullScratch()); 98 SkASSERT(fScratchKey.isNullScratch());
99 SkASSERT(scratchKey.isScratch()); 99 SkASSERT(scratchKey.isScratch());
100 SkASSERT(!scratchKey.isNullScratch()); 100 SkASSERT(!scratchKey.isNullScratch());
101 fScratchKey = scratchKey; 101 fScratchKey = scratchKey;
102 } 102 }
103 103
104 const GrResourceKey* GrGpuResource::getContentKey() const {
105 if (fCacheEntry && !fCacheEntry->key().isScratch()) {
106 return &fCacheEntry->key();
107 }
108 return NULL;
109 }
110
111 uint32_t GrGpuResource::CreateUniqueID() { 104 uint32_t GrGpuResource::CreateUniqueID() {
112 static int32_t gUniqueID = SK_InvalidUniqueID; 105 static int32_t gUniqueID = SK_InvalidUniqueID;
113 uint32_t id; 106 uint32_t id;
114 do { 107 do {
115 id = static_cast<uint32_t>(sk_atomic_inc(&gUniqueID) + 1); 108 id = static_cast<uint32_t>(sk_atomic_inc(&gUniqueID) + 1);
116 } while (id == SK_InvalidUniqueID); 109 } while (id == SK_InvalidUniqueID);
117 return id; 110 return id;
118 } 111 }
OLDNEW
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrResourceCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698