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 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
472 SkASSERT(data); | 472 SkASSERT(data); |
473 GrContext* context = reinterpret_cast<GrContext*>(data); | 473 GrContext* context = reinterpret_cast<GrContext*>(data); |
474 context->flush(); | 474 context->flush(); |
475 } | 475 } |
476 | 476 |
477 | 477 |
478 GrTexture* GrContext::createUncachedTexture(const GrSurfaceDesc& descIn, | 478 GrTexture* GrContext::createUncachedTexture(const GrSurfaceDesc& descIn, |
479 void* srcData, | 479 void* srcData, |
480 size_t rowBytes) { | 480 size_t rowBytes) { |
481 GrSurfaceDesc descCopy = descIn; | 481 GrSurfaceDesc descCopy = descIn; |
482 return fGpu->createTexture(descCopy, srcData, rowBytes); | 482 GrTexture* texture = fGpu->createTexture(descCopy, srcData, rowBytes); |
bsalomon
2014/11/13 19:20:54
This was the only function where we were deliberat
| |
483 if (texture) { | |
484 // TODO: It'd be nice to be able to do this before creation so we don't boot something | |
485 // out of the cache. We could temporarily boost the cache budget. | |
486 texture->cacheAccess().setBudgeted(false); | |
487 } | |
488 return texture; | |
483 } | 489 } |
484 | 490 |
485 void GrContext::getResourceCacheLimits(int* maxTextures, size_t* maxTextureBytes ) const { | 491 void GrContext::getResourceCacheLimits(int* maxTextures, size_t* maxTextureBytes ) const { |
486 if (maxTextures) { | 492 if (maxTextures) { |
487 *maxTextures = fResourceCache2->getMaxResourceCount(); | 493 *maxTextures = fResourceCache2->getMaxResourceCount(); |
488 } | 494 } |
489 if (maxTextureBytes) { | 495 if (maxTextureBytes) { |
490 *maxTextureBytes = fResourceCache2->getMaxResourceBytes(); | 496 *maxTextureBytes = fResourceCache2->getMaxResourceBytes(); |
491 } | 497 } |
492 } | 498 } |
(...skipping 1231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1724 fResourceCache2->printStats(); | 1730 fResourceCache2->printStats(); |
1725 } | 1731 } |
1726 #endif | 1732 #endif |
1727 | 1733 |
1728 #if GR_GPU_STATS | 1734 #if GR_GPU_STATS |
1729 const GrContext::GPUStats* GrContext::gpuStats() const { | 1735 const GrContext::GPUStats* GrContext::gpuStats() const { |
1730 return fGpu->gpuStats(); | 1736 return fGpu->gpuStats(); |
1731 } | 1737 } |
1732 #endif | 1738 #endif |
1733 | 1739 |
OLD | NEW |