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; |
} |
} |