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

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

Issue 1321353002: Limit lifetime of GrDrawContext objects (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update to ToT Created 5 years, 3 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
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 "GrContext.h" 9 #include "GrContext.h"
10 #include "GrDrawContext.h" 10 #include "GrDrawContext.h"
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 for (plot = fAtlas->iterInit(&iter, GrAtlas::kLRUFirst_IterOrder); 460 for (plot = fAtlas->iterInit(&iter, GrAtlas::kLRUFirst_IterOrder);
461 plot; 461 plot;
462 plot = iter.prev()) { 462 plot = iter.prev()) {
463 SkASSERT(0 == fPlotLocks[plot->id()]); 463 SkASSERT(0 == fPlotLocks[plot->id()]);
464 464
465 this->purgePlot(plot); 465 this->purgePlot(plot);
466 } 466 }
467 467
468 SkASSERT(0 == fPictureHash.count()); 468 SkASSERT(0 == fPictureHash.count());
469 469
470 GrDrawContext* drawContext = fContext->drawContext(); 470 SkAutoTUnref<GrDrawContext> drawContext(fContext->drawContext());
471 471
472 if (drawContext) { 472 if (drawContext) {
473 drawContext->discard(fAtlas->getTexture()->asRenderTarget()); 473 drawContext->discard(fAtlas->getTexture()->asRenderTarget());
474 } 474 }
475 } 475 }
476 #endif 476 #endif
477 477
478 void GrLayerCache::processDeletedPictures() { 478 void GrLayerCache::processDeletedPictures() {
479 SkTArray<SkPicture::DeletionMessage> deletedPictures; 479 SkTArray<SkPicture::DeletionMessage> deletedPictures;
480 fPictDeletionInbox.poll(&deletedPictures); 480 fPictDeletionInbox.poll(&deletedPictures);
(...skipping 28 matching lines...) Expand all
509 fileName.appendf("\\%d", layer->fKey.pictureID()); 509 fileName.appendf("\\%d", layer->fKey.pictureID());
510 for (int i = 0; i < layer->fKey.keySize(); ++i) { 510 for (int i = 0; i < layer->fKey.keySize(); ++i) {
511 fileName.appendf("-%d", layer->fKey.key()[i]); 511 fileName.appendf("-%d", layer->fKey.key()[i]);
512 } 512 }
513 fileName.appendf(".png"); 513 fileName.appendf(".png");
514 514
515 layer->texture()->surfacePriv().savePixels(fileName.c_str()); 515 layer->texture()->surfacePriv().savePixels(fileName.c_str());
516 } 516 }
517 } 517 }
518 #endif 518 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrRenderTarget.cpp » ('j') | src/gpu/GrRenderTarget.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698