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

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

Issue 611383003: Revert of GrResourceCache2 manages scratch texture. (Closed) Base URL: https://skia.googlesource.com/skia.git@surfimpl
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/SkGrPixelRef.cpp ('k') | src/image/SkSurface_Gpu.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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
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);
217 fTexture->unref(); 217 fTexture->unref();
218 fTexture = NULL; 218 fTexture = NULL;
219 fDesc.fContext->purgeCache();
219 } 220 }
220 221
221 void GrTextureStripAtlas::initLRU() { 222 void GrTextureStripAtlas::initLRU() {
222 fLRUFront = NULL; 223 fLRUFront = NULL;
223 fLRUBack = NULL; 224 fLRUBack = NULL;
224 // Initially all the rows are in the LRU list 225 // Initially all the rows are in the LRU list
225 for (int i = 0; i < fNumRows; ++i) { 226 for (int i = 0; i < fNumRows; ++i) {
226 fRows[i].fKey = kEmptyAtlasRowKey; 227 fRows[i].fKey = kEmptyAtlasRowKey;
227 fRows[i].fNext = NULL; 228 fRows[i].fNext = NULL;
228 fRows[i].fPrev = NULL; 229 fRows[i].fPrev = NULL;
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 339
339 // If we have locked rows, we should have a locked texture, otherwise 340 // If we have locked rows, we should have a locked texture, otherwise
340 // it should be unlocked 341 // it should be unlocked
341 if (fLockedRows == 0) { 342 if (fLockedRows == 0) {
342 SkASSERT(NULL == fTexture); 343 SkASSERT(NULL == fTexture);
343 } else { 344 } else {
344 SkASSERT(fTexture); 345 SkASSERT(fTexture);
345 } 346 }
346 } 347 }
347 #endif 348 #endif
OLDNEW
« no previous file with comments | « src/gpu/SkGrPixelRef.cpp ('k') | src/image/SkSurface_Gpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698