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

Side by Side Diff: src/gpu/effects/GrTextureStripAtlas.cpp

Issue 864383003: Remove createUncachedTexture function, attempt to recycle scratch in createTexture. (Closed) Base URL: https://skia.googlesource.com/skia.git@continue
Patch Set: Comments, fixes Created 5 years, 10 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/effects/GrConfigConversionEffect.cpp ('k') | tests/BlurTest.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 2012 Google Inc. 3 * Copyright 2012 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 "GrTextureStripAtlas.h" 9 #include "GrTextureStripAtlas.h"
10 #include "SkPixelRef.h" 10 #include "SkPixelRef.h"
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 texDesc.fConfig = fDesc.fConfig; 196 texDesc.fConfig = fDesc.fConfig;
197 197
198 static const GrContentKey::Domain kDomain = GrContentKey::GenerateDomain(); 198 static const GrContentKey::Domain kDomain = GrContentKey::GenerateDomain();
199 GrContentKey key; 199 GrContentKey key;
200 GrContentKey::Builder builder(&key, kDomain, 1); 200 GrContentKey::Builder builder(&key, kDomain, 1);
201 builder[0] = static_cast<uint32_t>(fCacheKey); 201 builder[0] = static_cast<uint32_t>(fCacheKey);
202 builder.finish(); 202 builder.finish();
203 203
204 fTexture = fDesc.fContext->findAndRefCachedTexture(key); 204 fTexture = fDesc.fContext->findAndRefCachedTexture(key);
205 if (NULL == fTexture) { 205 if (NULL == fTexture) {
206 fTexture = fDesc.fContext->createTexture(texDesc, NULL, 0); 206 fTexture = fDesc.fContext->createTexture(texDesc, true, NULL, 0);
207 SkAssertResult(fDesc.fContext->addResourceToCache(key, fTexture)); 207 SkAssertResult(fDesc.fContext->addResourceToCache(key, fTexture));
208 // This is a new texture, so all of our cache info is now invalid 208 // This is a new texture, so all of our cache info is now invalid
209 this->initLRU(); 209 this->initLRU();
210 fKeyTable.rewind(); 210 fKeyTable.rewind();
211 } 211 }
212 SkASSERT(fTexture); 212 SkASSERT(fTexture);
213 } 213 }
214 214
215 void GrTextureStripAtlas::unlockTexture() { 215 void GrTextureStripAtlas::unlockTexture() {
216 SkASSERT(fTexture && 0 == fLockedRows); 216 SkASSERT(fTexture && 0 == fLockedRows);
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 338
339 // If we have locked rows, we should have a locked texture, otherwise 339 // If we have locked rows, we should have a locked texture, otherwise
340 // it should be unlocked 340 // it should be unlocked
341 if (fLockedRows == 0) { 341 if (fLockedRows == 0) {
342 SkASSERT(NULL == fTexture); 342 SkASSERT(NULL == fTexture);
343 } else { 343 } else {
344 SkASSERT(fTexture); 344 SkASSERT(fTexture);
345 } 345 }
346 } 346 }
347 #endif 347 #endif
OLDNEW
« no previous file with comments | « src/gpu/effects/GrConfigConversionEffect.cpp ('k') | tests/BlurTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698