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

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

Issue 608883003: GrResourceCache2 manages scratch texture. (Closed) Base URL: https://skia.googlesource.com/skia.git@surfimpl
Patch Set: remove todo 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/GrInOrderDrawBuffer.h ('k') | src/gpu/GrOptDrawState.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 * 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());
249 layer->setTexture(NULL, GrIRect16::MakeEmpty()); 248 layer->setTexture(NULL, GrIRect16::MakeEmpty());
250 } 249 }
251 250
252 layer->setLocked(false); 251 layer->setLocked(false);
253 } 252 }
254 253
255 #ifdef SK_DEBUG 254 #ifdef SK_DEBUG
256 void GrLayerCache::validate() const { 255 void GrLayerCache::validate() const {
257 int plotLocks[kNumPlotsX * kNumPlotsY]; 256 int plotLocks[kNumPlotsX * kNumPlotsY];
258 memset(plotLocks, 0, sizeof(plotLocks)); 257 memset(plotLocks, 0, sizeof(plotLocks));
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 417
419 void GrLayerCache::processDeletedPictures() { 418 void GrLayerCache::processDeletedPictures() {
420 SkTDArray<GrPictureDeletedMessage> deletedPictures; 419 SkTDArray<GrPictureDeletedMessage> deletedPictures;
421 fPictDeletionInbox.poll(&deletedPictures); 420 fPictDeletionInbox.poll(&deletedPictures);
422 421
423 for (int i = 0; i < deletedPictures.count(); i++) { 422 for (int i = 0; i < deletedPictures.count(); i++) {
424 this->purge(deletedPictures[i].pictureID); 423 this->purge(deletedPictures[i].pictureID);
425 } 424 }
426 } 425 }
427 426
OLDNEW
« no previous file with comments | « src/gpu/GrInOrderDrawBuffer.h ('k') | src/gpu/GrOptDrawState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698