aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrContext.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2015-02-13 14:20:05 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-02-13 14:20:05 -0800
commit3582d3ee9fffdec715f5e4949a241ab08e6271ec (patch)
treeeab9709bbe8c4d00cd11fb987654cfb9e51acc65 /src/gpu/GrContext.cpp
parent4ccce7ea618fd9557a6d5cfa29c1fd6b015c7580 (diff)
Split out methods in GrGpuResource::CacheAccess that can be called outside of the cache.
Diffstat (limited to 'src/gpu/GrContext.cpp')
-rwxr-xr-xsrc/gpu/GrContext.cpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 6c6ec50356..26b30a434a 100755
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -13,7 +13,7 @@
#include "GrDefaultGeoProcFactory.h"
#include "GrFontCache.h"
#include "GrGpuResource.h"
-#include "GrGpuResourceCacheAccess.h"
+#include "GrGpuResourcePriv.h"
#include "GrDistanceFieldTextContext.h"
#include "GrDrawTargetCaps.h"
#include "GrGpu.h"
@@ -249,7 +249,7 @@ GrTexture* GrContext::createTexture(const GrSurfaceDesc& desc, bool budgeted, co
if (!srcData || texture->writePixels(0, 0, desc.fWidth, desc.fHeight, desc.fConfig,
srcData, rowBytes)) {
if (!budgeted) {
- texture->cacheAccess().makeUnbudgeted();
+ texture->resourcePriv().makeUnbudgeted();
}
return texture;
}
@@ -335,15 +335,7 @@ GrTexture* GrContext::internalRefScratchTexture(const GrSurfaceDesc& inDesc, uin
}
if (!(kNoCreate_ScratchTextureFlag & flags)) {
- GrTexture* texture = fGpu->createTexture(*desc, true, NULL, 0);
- #ifdef SK_DEBUG
- if (fGpu->caps()->reuseScratchTextures() || (desc->fFlags & kRenderTarget_GrSurfaceFlag)) {
- GrScratchKey key;
- GrTexturePriv::ComputeScratchKey(*desc, &key);
- SkASSERT(NULL == texture || texture->cacheAccess().getScratchKey() == key);
- }
- #endif
- return texture;
+ return fGpu->createTexture(*desc, true, NULL, 0);
}
return NULL;
@@ -1585,7 +1577,7 @@ bool GrContext::addResourceToCache(const GrContentKey& key, GrGpuResource* resou
if (!resource || resource->wasDestroyed()) {
return false;
}
- return resource->cacheAccess().setContentKey(key);
+ return resource->resourcePriv().setContentKey(key);
}
bool GrContext::isResourceInCache(const GrContentKey& key) const {