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 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 | 534 |
535 this->purgeCache(); | 535 this->purgeCache(); |
536 } | 536 } |
537 | 537 |
538 void GrContext::purgeCache() { | 538 void GrContext::purgeCache() { |
539 if (NULL != fTextureCache) { | 539 if (NULL != fTextureCache) { |
540 fTextureCache->purgeAsNeeded(); | 540 fTextureCache->purgeAsNeeded(); |
541 } | 541 } |
542 } | 542 } |
543 | 543 |
| 544 void GrContext::OverbudgetCB(void* data) { |
| 545 GrAssert(NULL != data); |
| 546 |
| 547 GrContext* context = reinterpret_cast<GrContext*>(data); |
| 548 |
| 549 // Flush the InOrderDrawBuffer to possibly free up some textures |
| 550 context->flush(); |
| 551 } |
| 552 |
| 553 |
544 GrTexture* GrContext::createUncachedTexture(const GrTextureDesc& descIn, | 554 GrTexture* GrContext::createUncachedTexture(const GrTextureDesc& descIn, |
545 void* srcData, | 555 void* srcData, |
546 size_t rowBytes) { | 556 size_t rowBytes) { |
547 GrTextureDesc descCopy = descIn; | 557 GrTextureDesc descCopy = descIn; |
548 return fGpu->createTexture(descCopy, srcData, rowBytes); | 558 return fGpu->createTexture(descCopy, srcData, rowBytes); |
549 } | 559 } |
550 | 560 |
551 void GrContext::getTextureCacheLimits(int* maxTextures, | 561 void GrContext::getTextureCacheLimits(int* maxTextures, |
552 size_t* maxTextureBytes) const { | 562 size_t* maxTextureBytes) const { |
553 fTextureCache->getLimits(maxTextures, maxTextureBytes); | 563 fTextureCache->getLimits(maxTextures, maxTextureBytes); |
(...skipping 1287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1841 return srcTexture; | 1851 return srcTexture; |
1842 } | 1852 } |
1843 } | 1853 } |
1844 | 1854 |
1845 /////////////////////////////////////////////////////////////////////////////// | 1855 /////////////////////////////////////////////////////////////////////////////// |
1846 #if GR_CACHE_STATS | 1856 #if GR_CACHE_STATS |
1847 void GrContext::printCacheStats() const { | 1857 void GrContext::printCacheStats() const { |
1848 fTextureCache->printStats(); | 1858 fTextureCache->printStats(); |
1849 } | 1859 } |
1850 #endif | 1860 #endif |
OLD | NEW |