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

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: update 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
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 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698