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 #include "GrContext.h" | 9 #include "GrContext.h" |
10 | 10 |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 | 483 |
484 // Flush the InOrderDrawBuffer to possibly free up some textures | 484 // Flush the InOrderDrawBuffer to possibly free up some textures |
485 context->fFlushToReduceCacheSize = true; | 485 context->fFlushToReduceCacheSize = true; |
486 } | 486 } |
487 | 487 |
488 | 488 |
489 GrTexture* GrContext::createUncachedTexture(const GrSurfaceDesc& descIn, | 489 GrTexture* GrContext::createUncachedTexture(const GrSurfaceDesc& descIn, |
490 void* srcData, | 490 void* srcData, |
491 size_t rowBytes) { | 491 size_t rowBytes) { |
492 GrSurfaceDesc descCopy = descIn; | 492 GrSurfaceDesc descCopy = descIn; |
493 return fGpu->createTexture(descCopy, srcData, rowBytes); | 493 GrTexture* texture = fGpu->createTexture(descCopy, srcData, rowBytes); |
| 494 if (texture) { |
| 495 // TODO: It'd be nice to be able to do this before creation so we don't
boot something |
| 496 // out of the cache. We could temporarily boost the cache budget. |
| 497 texture->cacheAccess().setBudgeted(false); |
| 498 } |
| 499 return texture; |
494 } | 500 } |
495 | 501 |
496 void GrContext::getResourceCacheLimits(int* maxTextures, size_t* maxTextureBytes
) const { | 502 void GrContext::getResourceCacheLimits(int* maxTextures, size_t* maxTextureBytes
) const { |
497 if (maxTextures) { | 503 if (maxTextures) { |
498 *maxTextures = fResourceCache2->getMaxResourceCount(); | 504 *maxTextures = fResourceCache2->getMaxResourceCount(); |
499 } | 505 } |
500 if (maxTextureBytes) { | 506 if (maxTextureBytes) { |
501 *maxTextureBytes = fResourceCache2->getMaxResourceBytes(); | 507 *maxTextureBytes = fResourceCache2->getMaxResourceBytes(); |
502 } | 508 } |
503 } | 509 } |
(...skipping 1229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1733 fResourceCache2->printStats(); | 1739 fResourceCache2->printStats(); |
1734 } | 1740 } |
1735 #endif | 1741 #endif |
1736 | 1742 |
1737 #if GR_GPU_STATS | 1743 #if GR_GPU_STATS |
1738 const GrContext::GPUStats* GrContext::gpuStats() const { | 1744 const GrContext::GPUStats* GrContext::gpuStats() const { |
1739 return fGpu->gpuStats(); | 1745 return fGpu->gpuStats(); |
1740 } | 1746 } |
1741 #endif | 1747 #endif |
1742 | 1748 |
OLD | NEW |