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

Unified Diff: src/gpu/GrResourceCache2.cpp

Issue 611383003: Revert of GrResourceCache2 manages scratch texture. (Closed) Base URL: https://skia.googlesource.com/skia.git@surfimpl
Patch Set: Created 6 years, 3 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/GrResourceCache2.h ('k') | src/gpu/GrTexture.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrResourceCache2.cpp
diff --git a/src/gpu/GrResourceCache2.cpp b/src/gpu/GrResourceCache2.cpp
index e2322a684e03fa3a336288f11fab4fc66f8403a5..e0ba26ae83516c54d4e87937bef28607f760b64d 100644
--- a/src/gpu/GrResourceCache2.cpp
+++ b/src/gpu/GrResourceCache2.cpp
@@ -8,8 +8,7 @@
#include "GrResourceCache2.h"
-#include "GrGpuResource.h"
-#include "SkRefCnt.h"
+#include "GrGpuResource.h"
GrResourceCache2::~GrResourceCache2() {
this->releaseAll();
@@ -56,18 +55,3 @@
SkASSERT(!fScratchMap.count());
SkASSERT(!fCount);
}
-
-class GrResourceCache2::AvailableForScratchUse {
-public:
- bool operator()(const GrGpuResource* resource) const {
- // Because duties are currently shared between GrResourceCache and GrResourceCache2, the
- // current interpretation of this rule is that only GrResourceCache has a ref but that
- // it has been marked as a scratch resource.
- return resource->reffedOnlyByCache() && GrIORef::kYes_IsScratch == resource->fIsScratch;
- }
-};
-
-GrGpuResource* GrResourceCache2::findAndRefScratchResource(const GrResourceKey& scratchKey) {
- SkASSERT(scratchKey.isScratch());
- return SkSafeRef(fScratchMap.find(scratchKey, AvailableForScratchUse()));
-}
« no previous file with comments | « src/gpu/GrResourceCache2.h ('k') | src/gpu/GrTexture.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698