aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/GrResourceCacheBench.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2014-10-09 09:57:18 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-10-09 09:57:18 -0700
commit1e2530babb65a883a01df5ee87147432f6707ce3 (patch)
tree01ee9574c04082db140cbb07cbe09575bf9481b8 /bench/GrResourceCacheBench.cpp
parentcf9b87389fa6f209617afbb1e62b9d9c36a2a374 (diff)
Use presence of a content key as non-scratch indicator
Diffstat (limited to 'bench/GrResourceCacheBench.cpp')
-rw-r--r--bench/GrResourceCacheBench.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/bench/GrResourceCacheBench.cpp b/bench/GrResourceCacheBench.cpp
index 894ec14fca..6a7c89acf8 100644
--- a/bench/GrResourceCacheBench.cpp
+++ b/bench/GrResourceCacheBench.cpp
@@ -64,7 +64,14 @@ public:
}
static GrResourceKey ComputeKey(const GrTextureDesc& desc) {
- return GrTexturePriv::ComputeScratchKey(desc);
+ GrCacheID::Key key;
+ memset(&key, 0, sizeof(key));
+ key.fData32[0] = (desc.fWidth) | (desc.fHeight << 16);
+ key.fData32[1] = desc.fConfig | desc.fSampleCnt << 16;
+ key.fData32[2] = desc.fFlags;
+ static int gType = GrResourceKey::GenerateResourceType();
+ static int gDomain = GrCacheID::GenerateDomain();
+ return GrResourceKey(GrCacheID(gDomain, key), gType, 0);
}
int fID;