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

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

Issue 18770007: Add a 'unique' method to SkRefCnt, document the usage, and add support. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "GrContext.h" 10 #include "GrContext.h"
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 if (NULL == texture) { 506 if (NULL == texture) {
507 return; 507 return;
508 } 508 }
509 509
510 // This texture should already have a cache entry since it was once 510 // This texture should already have a cache entry since it was once
511 // attached 511 // attached
512 GrAssert(NULL != texture->getCacheEntry()); 512 GrAssert(NULL != texture->getCacheEntry());
513 513
514 // Conceptually, the cache entry is going to assume responsibility 514 // Conceptually, the cache entry is going to assume responsibility
515 // for the creation ref. 515 // for the creation ref.
516 GrAssert(1 == texture->getRefCnt()); 516 GrAssert(texture->unique());
517 517
518 // Since this texture came from an AutoScratchTexture it should 518 // Since this texture came from an AutoScratchTexture it should
519 // still be in the exclusive pile 519 // still be in the exclusive pile
520 fTextureCache->makeNonExclusive(texture->getCacheEntry()); 520 fTextureCache->makeNonExclusive(texture->getCacheEntry());
521 521
522 this->purgeCache(); 522 this->purgeCache();
523 } 523 }
524 524
525 525
526 void GrContext::unlockScratchTexture(GrTexture* texture) { 526 void GrContext::unlockScratchTexture(GrTexture* texture) {
(...skipping 1330 matching lines...) Expand 10 before | Expand all | Expand 10 after
1857 return srcTexture; 1857 return srcTexture;
1858 } 1858 }
1859 } 1859 }
1860 1860
1861 /////////////////////////////////////////////////////////////////////////////// 1861 ///////////////////////////////////////////////////////////////////////////////
1862 #if GR_CACHE_STATS 1862 #if GR_CACHE_STATS
1863 void GrContext::printCacheStats() const { 1863 void GrContext::printCacheStats() const {
1864 fTextureCache->printStats(); 1864 fTextureCache->printStats();
1865 } 1865 }
1866 #endif 1866 #endif
OLDNEW
« src/core/SkPathRef.h ('K') | « src/core/SkTypefaceCache.cpp ('k') | src/gpu/GrEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698