| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |