Split cache-specific fields out of GrTextureDesc
http://codereview.appspot.com/6448143/
git-svn-id: http://skia.googlecode.com/svn/trunk@5065 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrTexture.cpp b/src/gpu/GrTexture.cpp
index 208bd2e..d2e2736 100644
--- a/src/gpu/GrTexture.cpp
+++ b/src/gpu/GrTexture.cpp
@@ -138,20 +138,21 @@
void gen_texture_key_values(const GrGpu* gpu,
const GrTextureParams* params,
const GrTextureDesc& desc,
+ const GrCacheData& cacheData,
bool scratch,
GrCacheID* cacheID) {
- uint64_t clientKey = desc.fClientCacheID;
+ uint64_t clientKey = cacheData.fClientCacheID;
if (scratch) {
// Instead of a client-provided key of the texture contents
// we create a key from the descriptor.
- GrAssert(kScratch_CacheID == clientKey);
+ GrAssert(GrCacheData::kScratch_CacheID == clientKey);
clientKey = (desc.fFlags << 8) | ((uint64_t) desc.fConfig << 32);
}
cacheID->fPublicID = clientKey;
- cacheID->fDomain = desc.fResourceDomain;
+ cacheID->fDomain = cacheData.fResourceDomain;
// we assume we only need 16 bits of width and height
// assert that texture creation will fail anyway if this assumption
@@ -184,9 +185,10 @@
GrResourceKey GrTexture::ComputeKey(const GrGpu* gpu,
const GrTextureParams* params,
const GrTextureDesc& desc,
+ const GrCacheData& cacheData,
bool scratch) {
GrCacheID id(GrTexture::GetResourceType());
- gen_texture_key_values(gpu, params, desc, scratch, &id);
+ gen_texture_key_values(gpu, params, desc, cacheData, scratch, &id);
uint32_t v[4];
id.toRaw(v);