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

Side by Side Diff: src/gpu/GrLayerCache.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/GrContext.cpp ('k') | src/gpu/GrResourceCache.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 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrAtlas.h" 8 #include "GrAtlas.h"
9 #include "GrGpu.h" 9 #include "GrGpu.h"
10 #include "GrLayerCache.h" 10 #include "GrLayerCache.h"
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 GrPictureInfo* pictInfo = fPictureHash.find(layer->pictureID()); 238 GrPictureInfo* pictInfo = fPictureHash.find(layer->pictureID());
239 SkASSERT(pictInfo); 239 SkASSERT(pictInfo);
240 240
241 GrAtlas::RemovePlot(&pictInfo->fPlotUsage, layer->plot()); 241 GrAtlas::RemovePlot(&pictInfo->fPlotUsage, layer->plot());
242 242
243 layer->setPlot(NULL); 243 layer->setPlot(NULL);
244 layer->setTexture(NULL, GrIRect16::MakeEmpty()); 244 layer->setTexture(NULL, GrIRect16::MakeEmpty());
245 #endif 245 #endif
246 246
247 } else { 247 } else {
248 fContext->unlockScratchTexture(layer->texture());
248 layer->setTexture(NULL, GrIRect16::MakeEmpty()); 249 layer->setTexture(NULL, GrIRect16::MakeEmpty());
249 } 250 }
250 251
251 layer->setLocked(false); 252 layer->setLocked(false);
252 } 253 }
253 254
254 #ifdef SK_DEBUG 255 #ifdef SK_DEBUG
255 void GrLayerCache::validate() const { 256 void GrLayerCache::validate() const {
256 int plotLocks[kNumPlotsX * kNumPlotsY]; 257 int plotLocks[kNumPlotsX * kNumPlotsY];
257 memset(plotLocks, 0, sizeof(plotLocks)); 258 memset(plotLocks, 0, sizeof(plotLocks));
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 416
416 void GrLayerCache::processDeletedPictures() { 417 void GrLayerCache::processDeletedPictures() {
417 SkTDArray<GrPictureDeletedMessage> deletedPictures; 418 SkTDArray<GrPictureDeletedMessage> deletedPictures;
418 fPictDeletionInbox.poll(&deletedPictures); 419 fPictDeletionInbox.poll(&deletedPictures);
419 420
420 for (int i = 0; i < deletedPictures.count(); i++) { 421 for (int i = 0; i < deletedPictures.count(); i++) {
421 this->purge(deletedPictures[i].pictureID); 422 this->purge(deletedPictures[i].pictureID);
422 } 423 }
423 } 424 }
424 425
OLDNEW
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrResourceCache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698