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

Unified Diff: src/gpu/GrGpuResource.cpp

Issue 846303002: Make uncached textures uncached from the get go. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add comment Created 5 years, 11 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/GrGpu.cpp ('k') | src/gpu/GrGpuResourceCacheAccess.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrGpuResource.cpp
diff --git a/src/gpu/GrGpuResource.cpp b/src/gpu/GrGpuResource.cpp
index b2fad0b3f7da2dcd7df53c2d21851be26ce71705..a2df7e13e8cd388922b840a6b8fbadf34e5e3509 100644
--- a/src/gpu/GrGpuResource.cpp
+++ b/src/gpu/GrGpuResource.cpp
@@ -18,16 +18,12 @@ static inline GrResourceCache2* get_resource_cache2(GrGpu* gpu) {
return gpu->getContext()->getResourceCache2();
}
-GrGpuResource::GrGpuResource(GrGpu* gpu, bool isWrapped)
+GrGpuResource::GrGpuResource(GrGpu* gpu, LifeCycle lifeCycle)
: fGpu(gpu)
, fGpuMemorySize(kInvalidGpuMemorySize)
+ , fFlags(0)
+ , fLifeCycle(lifeCycle)
, fUniqueID(CreateUniqueID()) {
- if (isWrapped) {
- fFlags = kWrapped_Flag;
- } else {
- // By default all non-wrapped resources are budgeted.
- fFlags = kBudgeted_Flag;
- }
}
void GrGpuResource::registerWithCache() {
@@ -146,21 +142,3 @@ uint32_t GrGpuResource::CreateUniqueID() {
} while (id == SK_InvalidUniqueID);
return id;
}
-
-void GrGpuResource::setBudgeted(bool countsAgainstBudget) {
- // Wrapped resources never count against the budget, nothing to do. No point in changing the
- // budgeting of destroyed resources.
- if (this->isWrapped() || this->wasDestroyed()) {
- return;
- }
-
- uint32_t oldFlags = fFlags;
- if (countsAgainstBudget) {
- fFlags |= kBudgeted_Flag;
- } else {
- fFlags &= ~kBudgeted_Flag;
- }
- if (fFlags != oldFlags) {
- get_resource_cache2(fGpu)->resourceAccess().didChangeBudgetStatus(this);
- }
-}
« no previous file with comments | « src/gpu/GrGpu.cpp ('k') | src/gpu/GrGpuResourceCacheAccess.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698