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

Unified Diff: src/gpu/GrResourceCache.cpp

Issue 1734043002: Revert of Move Budgeted enum out of SkSurface, use in GrTextureProvider (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 005b6c4ccd24177c5630d7bd198a43340262cd81..4a0c9b2b369bbc12cb4254dedeaae16b929454d6 100644
--- a/src/gpu/GrResourceCache.cpp
+++ b/src/gpu/GrResourceCache.cpp
@@ -136,7 +136,7 @@
fHighWaterCount = SkTMax(this->getResourceCount(), fHighWaterCount);
fHighWaterBytes = SkTMax(fBytes, fHighWaterBytes);
#endif
- if (SkBudgeted::kYes == resource->resourcePriv().isBudgeted()) {
+ if (resource->resourcePriv().isBudgeted()) {
++fBudgetedCount;
fBudgetedBytes += size;
TRACE_COUNTER2(TRACE_DISABLED_BY_DEFAULT("skia.gpu.cache"), "skia budget", "used",
@@ -167,7 +167,7 @@
size_t size = resource->gpuMemorySize();
SkDEBUGCODE(--fCount;)
fBytes -= size;
- if (SkBudgeted::kYes == resource->resourcePriv().isBudgeted()) {
+ if (resource->resourcePriv().isBudgeted()) {
--fBudgetedCount;
fBudgetedBytes -= size;
TRACE_COUNTER2(TRACE_DISABLED_BY_DEFAULT("skia.gpu.cache"), "skia budget", "used",
@@ -375,7 +375,7 @@
this->removeFromNonpurgeableArray(resource);
fPurgeableQueue.insert(resource);
- if (SkBudgeted::kNo == resource->resourcePriv().isBudgeted()) {
+ if (!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 @@
#if GR_CACHE_STATS
fHighWaterBytes = SkTMax(fBytes, fHighWaterBytes);
#endif
- if (SkBudgeted::kYes == resource->resourcePriv().isBudgeted()) {
+ if (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 @@
size_t size = resource->gpuMemorySize();
- if (SkBudgeted::kYes == resource->resourcePriv().isBudgeted()) {
+ if (resource->resourcePriv().isBudgeted()) {
++fBudgetedCount;
fBudgetedBytes += size;
#if GR_CACHE_STATS
@@ -664,7 +664,7 @@
SkASSERT(fScratchMap->countForKey(resource->resourcePriv().getScratchKey()));
SkASSERT(!resource->cacheAccess().isExternal());
} else if (resource->resourcePriv().getScratchKey().isValid()) {
- SkASSERT(SkBudgeted::kNo == resource->resourcePriv().isBudgeted() ||
+ SkASSERT(!resource->resourcePriv().isBudgeted() ||
resource->getUniqueKey().isValid());
++fCouldBeScratch;
SkASSERT(fScratchMap->countForKey(resource->resourcePriv().getScratchKey()));
@@ -675,10 +675,10 @@
++fContent;
SkASSERT(fUniqueHash->find(uniqueKey) == resource);
SkASSERT(!resource->cacheAccess().isExternal());
- SkASSERT(SkBudgeted::kYes == resource->resourcePriv().isBudgeted());
- }
-
- if (SkBudgeted::kYes == resource->resourcePriv().isBudgeted()) {
+ SkASSERT(resource->resourcePriv().isBudgeted());
+ }
+
+ if (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