aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrResourceCache2.cpp
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2014-10-07 15:07:38 -0400
committerGravatar Brian Salomon <bsalomon@google.com>2014-10-07 15:07:38 -0400
commit9323b8b8e16df4adcd63ee8496a6382e8df535c9 (patch)
tree12ff0bd9f07193593b7db1d52ef2fe0478c00aeb /src/gpu/GrResourceCache2.cpp
parent65be97d1a1eb5923b078bd1e7ec1e7da6e6427e2 (diff)
Revert "GrResourceCache2 manages scratch texture."
Diffstat (limited to 'src/gpu/GrResourceCache2.cpp')
-rw-r--r--src/gpu/GrResourceCache2.cpp31
1 files changed, 1 insertions, 30 deletions
diff --git a/src/gpu/GrResourceCache2.cpp b/src/gpu/GrResourceCache2.cpp
index 1ed66696a7..e0ba26ae83 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,31 +55,3 @@ void GrResourceCache2::releaseAll() {
SkASSERT(!fScratchMap.count());
SkASSERT(!fCount);
}
-
-class GrResourceCache2::AvailableForScratchUse {
-public:
- AvailableForScratchUse(bool calledDuringFlush) : fFlushing(calledDuringFlush) { }
-
- bool operator()(const GrGpuResource* resource) const {
- if (fFlushing) {
- // If this request is coming during draw buffer flush then no refs are allowed
- // either by drawing code or for pending io operations.
- // This will be removed when flush no longer creates resources.
- return resource->reffedOnlyByCache() && !resource->internalHasPendingIO() &&
- GrIORef::kYes_IsScratch == resource->fIsScratch;
- } else {
- // 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;
- }
- }
-private:
- bool fFlushing;
-};
-
-GrGpuResource* GrResourceCache2::findAndRefScratchResource(const GrResourceKey& scratchKey,
- bool calledDuringFlush) {
- SkASSERT(scratchKey.isScratch());
- return SkSafeRef(fScratchMap.find(scratchKey, AvailableForScratchUse(calledDuringFlush)));
-}