diff options
author | bsalomon <bsalomon@google.com> | 2014-07-25 07:32:33 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-07-25 07:32:33 -0700 |
commit | c44be0e9e4cee5402909c06370a630eee188a8f3 (patch) | |
tree | 1646e237481d61d979143fb57cf87a51cdfcf976 /src/gpu/GrContext.cpp | |
parent | 730c0447916909f01df7fa12e9c82dd7cf7989dc (diff) |
Merge GrGpuObject and GrCacheable.
We want to create a new base class for "meta" gr resources as part of the GrResourceCache rewrite and this is an iterim step towards that goal.s
R=robertphillips@google.com
Author: bsalomon@google.com
Review URL: https://codereview.chromium.org/414013005
Diffstat (limited to 'src/gpu/GrContext.cpp')
-rwxr-xr-x | src/gpu/GrContext.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp index a815263d13..d3edd21e5f 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; } |