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

Unified Diff: src/gpu/GrContext.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/GrCacheable.cpp ('k') | src/gpu/GrGpu.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrContext.cpp
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index a815263d13fbf9ce963820a5b9a3bd7cd68f10ea..d3edd21e5f40ea22de774c72c06b9bb8d5c9686f 100755
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -257,7 +257,7 @@ GrTexture* GrContext::findAndRefTexture(const GrTextureDesc& desc,
const GrCacheID& cacheID,
const GrTextureParams* params) {
GrResourceKey resourceKey = GrTextureImpl::ComputeKey(fGpu, params, desc, cacheID);
- GrCacheable* resource = fResourceCache->find(resourceKey);
+ GrGpuObject* resource = fResourceCache->find(resourceKey);
SkSafeRef(resource);
return static_cast<GrTexture*>(resource);
}
@@ -283,7 +283,7 @@ GrStencilBuffer* GrContext::findStencilBuffer(int width, int height,
GrResourceKey resourceKey = GrStencilBuffer::ComputeKey(width,
height,
sampleCnt);
- GrCacheable* resource = fResourceCache->find(resourceKey);
+ GrGpuObject* resource = fResourceCache->find(resourceKey);
return static_cast<GrStencilBuffer*>(resource);
}
@@ -471,7 +471,7 @@ GrTexture* GrContext::lockAndRefScratchTexture(const GrTextureDesc& inDesc, Scra
desc.fHeight = SkTMax(MIN_SIZE, GrNextPow2(desc.fHeight));
}
- GrCacheable* resource = NULL;
+ GrGpuObject* resource = NULL;
int origWidth = desc.fWidth;
int origHeight = desc.fHeight;
@@ -1903,13 +1903,13 @@ GrPath* GrContext::createPath(const SkPath& inPath, const SkStrokeRec& stroke) {
return path;
}
-void GrContext::addResourceToCache(const GrResourceKey& resourceKey, GrCacheable* resource) {
+void GrContext::addResourceToCache(const GrResourceKey& resourceKey, GrGpuObject* resource) {
fResourceCache->purgeAsNeeded(1, resource->gpuMemorySize());
fResourceCache->addResource(resourceKey, resource);
}
-GrCacheable* GrContext::findAndRefCachedResource(const GrResourceKey& resourceKey) {
- GrCacheable* resource = fResourceCache->find(resourceKey);
+GrGpuObject* GrContext::findAndRefCachedResource(const GrResourceKey& resourceKey) {
+ GrGpuObject* resource = fResourceCache->find(resourceKey);
SkSafeRef(resource);
return resource;
}
« no previous file with comments | « src/gpu/GrCacheable.cpp ('k') | src/gpu/GrGpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698