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

Unified Diff: src/gpu/GrResourceCache.cpp

Issue 1728093005: Move Budgeted enum out of SkSurface, use in GrTextureProvider (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add aliases for Chrome Created 4 years, 10 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrResourceCache.h ('k') | src/gpu/GrTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrResourceCache.cpp
diff --git a/src/gpu/GrResourceCache.cpp b/src/gpu/GrResourceCache.cpp
index 4a0c9b2b369bbc12cb4254dedeaae16b929454d6..005b6c4ccd24177c5630d7bd198a43340262cd81 100644
--- a/src/gpu/GrResourceCache.cpp
+++ b/src/gpu/GrResourceCache.cpp
@@ -136,7 +136,7 @@ void GrResourceCache::insertResource(GrGpuResource* resource) {
fHighWaterCount = SkTMax(this->getResourceCount(), fHighWaterCount);
fHighWaterBytes = SkTMax(fBytes, fHighWaterBytes);
#endif
- if (resource->resourcePriv().isBudgeted()) {
+ if (SkBudgeted::kYes == resource->resourcePriv().isBudgeted()) {
++fBudgetedCount;
fBudgetedBytes += size;
TRACE_COUNTER2(TRACE_DISABLED_BY_DEFAULT("skia.gpu.cache"), "skia budget", "used",
@@ -167,7 +167,7 @@ void GrResourceCache::removeResource(GrGpuResource* resource) {
size_t size = resource->gpuMemorySize();
SkDEBUGCODE(--fCount;)
fBytes -= size;
- if (resource->resourcePriv().isBudgeted()) {
+ if (SkBudgeted::kYes == resource->resourcePriv().isBudgeted()) {
--fBudgetedCount;
fBudgetedBytes -= size;
TRACE_COUNTER2(TRACE_DISABLED_BY_DEFAULT("skia.gpu.cache"), "skia budget", "used",
@@ -375,7 +375,7 @@ void GrResourceCache::notifyCntReachedZero(GrGpuResource* resource, uint32_t fla
this->removeFromNonpurgeableArray(resource);
fPurgeableQueue.insert(resource);
- if (!resource->resourcePriv().isBudgeted()) {
+ if (SkBudgeted::kNo == resource->resourcePriv().isBudgeted()) {
// Check whether this resource could still be used as a scratch resource.
if (!resource->cacheAccess().isExternal() &&
resource->resourcePriv().getScratchKey().isValid()) {
@@ -414,7 +414,7 @@ void GrResourceCache::didChangeGpuMemorySize(const GrGpuResource* resource, size
#if GR_CACHE_STATS
fHighWaterBytes = SkTMax(fBytes, fHighWaterBytes);
#endif
- if (resource->resourcePriv().isBudgeted()) {
+ if (SkBudgeted::kYes == resource->resourcePriv().isBudgeted()) {
fBudgetedBytes += delta;
TRACE_COUNTER2(TRACE_DISABLED_BY_DEFAULT("skia.gpu.cache"), "skia budget", "used",
fBudgetedBytes, "free", fMaxBytes - fBudgetedBytes);
@@ -433,7 +433,7 @@ void GrResourceCache::didChangeBudgetStatus(GrGpuResource* resource) {
size_t size = resource->gpuMemorySize();
- if (resource->resourcePriv().isBudgeted()) {
+ if (SkBudgeted::kYes == resource->resourcePriv().isBudgeted()) {
++fBudgetedCount;
fBudgetedBytes += size;
#if GR_CACHE_STATS
@@ -664,7 +664,7 @@ void GrResourceCache::validate() const {
SkASSERT(fScratchMap->countForKey(resource->resourcePriv().getScratchKey()));
SkASSERT(!resource->cacheAccess().isExternal());
} else if (resource->resourcePriv().getScratchKey().isValid()) {
- SkASSERT(!resource->resourcePriv().isBudgeted() ||
+ SkASSERT(SkBudgeted::kNo == resource->resourcePriv().isBudgeted() ||
resource->getUniqueKey().isValid());
++fCouldBeScratch;
SkASSERT(fScratchMap->countForKey(resource->resourcePriv().getScratchKey()));
@@ -675,10 +675,10 @@ void GrResourceCache::validate() const {
++fContent;
SkASSERT(fUniqueHash->find(uniqueKey) == resource);
SkASSERT(!resource->cacheAccess().isExternal());
- SkASSERT(resource->resourcePriv().isBudgeted());
+ SkASSERT(SkBudgeted::kYes == resource->resourcePriv().isBudgeted());
}
- if (resource->resourcePriv().isBudgeted()) {
+ if (SkBudgeted::kYes == resource->resourcePriv().isBudgeted()) {
++fBudgetedCount;
fBudgetedBytes += resource->gpuMemorySize();
}
« no previous file with comments | « src/gpu/GrResourceCache.h ('k') | src/gpu/GrTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698