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

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

Issue 764393002: Add additional clean up code in MPD path (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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 | « no previous file | no next file » | 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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 *needsRendering = true; 219 *needsRendering = true;
220 return true; 220 return true;
221 } 221 }
222 222
223 // The layer was rejected by the atlas (even though we know it is 223 // The layer was rejected by the atlas (even though we know it is
224 // plausibly atlas-able). See if a plot can be purged and try again. 224 // plausibly atlas-able). See if a plot can be purged and try again.
225 if (!this->purgePlot()) { 225 if (!this->purgePlot()) {
226 break; // We weren't able to purge any plots 226 break; // We weren't able to purge any plots
227 } 227 }
228 } 228 }
229
230 if (pictInfo->fPlotUsage.isEmpty()) {
231 fPictureHash.remove(pictInfo->fPictureID);
232 SkDELETE(pictInfo);
233 }
229 } 234 }
230 235
231 return false; 236 return false;
232 } 237 }
233 238
234 bool GrLayerCache::lock(GrCachedLayer* layer, const GrSurfaceDesc& desc, bool* n eedsRendering) { 239 bool GrLayerCache::lock(GrCachedLayer* layer, const GrSurfaceDesc& desc, bool* n eedsRendering) {
235 if (layer->locked()) { 240 if (layer->locked()) {
236 // This layer is already locked 241 // This layer is already locked
237 *needsRendering = false; 242 *needsRendering = false;
238 return true; 243 return true;
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 fileName.appendf("\\%d", layer->fKey.pictureID()); 495 fileName.appendf("\\%d", layer->fKey.pictureID());
491 for (int i = 0; i < layer->fKey.keySize(); ++i) { 496 for (int i = 0; i < layer->fKey.keySize(); ++i) {
492 fileName.appendf("-%d", layer->fKey.key()[i]); 497 fileName.appendf("-%d", layer->fKey.key()[i]);
493 } 498 }
494 fileName.appendf(".png"); 499 fileName.appendf(".png");
495 500
496 layer->texture()->surfacePriv().savePixels(fileName.c_str()); 501 layer->texture()->surfacePriv().savePixels(fileName.c_str());
497 } 502 }
498 } 503 }
499 #endif 504 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698