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

Unified Diff: src/gpu/GrResourceCache.cpp

Issue 414013005: Merge GrGpuObject and GrCacheable. (Closed) Base URL: https://skia.googlesource.com/skia.git@uniqueid
Patch Set: Address comments Created 6 years, 5 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/GrResourceCache.h ('k') | src/gpu/GrStencilAndCoverTextContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrResourceCache.cpp
diff --git a/src/gpu/GrResourceCache.cpp b/src/gpu/GrResourceCache.cpp
index ac10ebc6413d60f339b5fd0bf7a87f3cbdbe7865..13568e4965d57a02486e60100836132705757f47 100644
--- a/src/gpu/GrResourceCache.cpp
+++ b/src/gpu/GrResourceCache.cpp
@@ -9,13 +9,13 @@
#include "GrResourceCache.h"
-#include "GrCacheable.h"
+#include "GrGpuObject.h"
DECLARE_SKMESSAGEBUS_MESSAGE(GrResourceInvalidatedMessage);
///////////////////////////////////////////////////////////////////////////////
-void GrCacheable::didChangeGpuMemorySize() const {
+void GrGpuObject::didChangeGpuMemorySize() const {
if (this->isInCache()) {
fCacheEntry->didChangeResourceSize();
}
@@ -38,7 +38,7 @@ GrResourceKey::ResourceType GrResourceKey::GenerateResourceType() {
GrResourceCacheEntry::GrResourceCacheEntry(GrResourceCache* resourceCache,
const GrResourceKey& key,
- GrCacheable* resource)
+ GrGpuObject* resource)
: fResourceCache(resourceCache),
fKey(key),
fResource(resource),
@@ -197,7 +197,7 @@ public:
}
};
-GrCacheable* GrResourceCache::find(const GrResourceKey& key, uint32_t ownershipFlags) {
+GrGpuObject* GrResourceCache::find(const GrResourceKey& key, uint32_t ownershipFlags) {
GrAutoResourceCacheValidate atcv(this);
GrResourceCacheEntry* entry = NULL;
@@ -226,7 +226,7 @@ GrCacheable* GrResourceCache::find(const GrResourceKey& key, uint32_t ownershipF
}
void GrResourceCache::addResource(const GrResourceKey& key,
- GrCacheable* resource,
+ GrGpuObject* resource,
uint32_t ownershipFlags) {
SkASSERT(NULL == resource->getCacheEntry());
// we don't expect to create new resources during a purge. In theory
@@ -285,7 +285,7 @@ void GrResourceCache::makeNonExclusive(GrResourceCacheEntry* entry) {
fExclusiveList.remove(entry);
#endif
- if (entry->resource()->isValidOnGpu()) {
+ if (!entry->resource()->wasDestroyed()) {
// Since scratch textures still count against the cache budget even
// when they have been removed from the cache, re-adding them doesn't
// alter the budget information.
« no previous file with comments | « src/gpu/GrResourceCache.h ('k') | src/gpu/GrStencilAndCoverTextContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698