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

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

Issue 721353002: Allow GPU resources to not be counted against the cache budget. (Closed) Base URL: https://skia.googlesource.com/skia.git@wrap
Patch Set: fix constructor order Created 6 years, 1 month 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
« no previous file with comments | « include/gpu/GrGpuResource.h ('k') | src/gpu/GrGpuResource.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "GrContext.h" 9 #include "GrContext.h"
10 10
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « include/gpu/GrGpuResource.h ('k') | src/gpu/GrGpuResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698