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

Unified Diff: src/gpu/GrGpuResource.cpp

Issue 477323006: Revert of Add GrResourceCache2. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 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/GrLayerCache.cpp » ('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 7a19c25e46dcf5806db47955b7f22818d75f95a5..8c2dc4508009a10fa181fd477636c35743b94a1d 100644
--- a/src/gpu/GrGpuResource.cpp
+++ b/src/gpu/GrGpuResource.cpp
@@ -8,27 +8,19 @@
#include "GrGpuResource.h"
-#include "GrResourceCache2.h"
#include "GrGpu.h"
-static inline GrResourceCache2* get_resource_cache2(GrGpu* gpu) {
- SkASSERT(NULL != gpu);
- SkASSERT(NULL != gpu->getContext());
- SkASSERT(NULL != gpu->getContext()->getResourceCache2());
- return gpu->getContext()->getResourceCache2();
-}
-
GrGpuResource::GrGpuResource(GrGpu* gpu, bool isWrapped)
- : fGpu(gpu)
- , fRefCnt(1)
+ : fRefCnt(1)
, fCacheEntry(NULL)
, fUniqueID(CreateUniqueID()) {
+ fGpu = gpu;
if (isWrapped) {
fFlags = kWrapped_FlagBit;
} else {
fFlags = 0;
}
- get_resource_cache2(fGpu)->insertResource(this);
+ fGpu->insertObject(this);
}
GrGpuResource::~GrGpuResource() {
@@ -40,7 +32,7 @@
void GrGpuResource::release() {
if (NULL != fGpu) {
this->onRelease();
- get_resource_cache2(fGpu)->removeResource(this);
+ fGpu->removeObject(this);
fGpu = NULL;
}
}
@@ -48,7 +40,7 @@
void GrGpuResource::abandon() {
if (NULL != fGpu) {
this->onAbandon();
- get_resource_cache2(fGpu)->removeResource(this);
+ fGpu->removeObject(this);
fGpu = NULL;
}
}
« no previous file with comments | « src/gpu/GrGpu.cpp ('k') | src/gpu/GrLayerCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698