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

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

Issue 1404823005: GrDrawContext now holds GrRenderTarget pointer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix overlength line Created 5 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/GrDrawContext.cpp ('k') | src/gpu/GrRenderTarget.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 "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 SkAutoTUnref<GrDrawContext> drawContext(fContext->drawContext()); 470 SkAutoTUnref<GrDrawContext> drawContext(
471 fContext->drawContext(fAtlas->getTexture()->asRe nderTarget()));
471 472
472 if (drawContext) { 473 if (drawContext) {
473 drawContext->discard(fAtlas->getTexture()->asRenderTarget()); 474 drawContext->discard();
474 } 475 }
475 } 476 }
476 #endif 477 #endif
477 478
478 void GrLayerCache::processDeletedPictures() { 479 void GrLayerCache::processDeletedPictures() {
479 SkTArray<SkPicture::DeletionMessage> deletedPictures; 480 SkTArray<SkPicture::DeletionMessage> deletedPictures;
480 fPictDeletionInbox.poll(&deletedPictures); 481 fPictDeletionInbox.poll(&deletedPictures);
481 482
482 for (int i = 0; i < deletedPictures.count(); i++) { 483 for (int i = 0; i < deletedPictures.count(); i++) {
483 this->purge(deletedPictures[i].fUniqueID); 484 this->purge(deletedPictures[i].fUniqueID);
(...skipping 25 matching lines...) Expand all
509 fileName.appendf("\\%d", layer->fKey.pictureID()); 510 fileName.appendf("\\%d", layer->fKey.pictureID());
510 for (int i = 0; i < layer->fKey.keySize(); ++i) { 511 for (int i = 0; i < layer->fKey.keySize(); ++i) {
511 fileName.appendf("-%d", layer->fKey.key()[i]); 512 fileName.appendf("-%d", layer->fKey.key()[i]);
512 } 513 }
513 fileName.appendf(".png"); 514 fileName.appendf(".png");
514 515
515 layer->texture()->surfacePriv().savePixels(fileName.c_str()); 516 layer->texture()->surfacePriv().savePixels(fileName.c_str());
516 } 517 }
517 } 518 }
518 #endif 519 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrDrawContext.cpp ('k') | src/gpu/GrRenderTarget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698