diff options
author | bsalomon <bsalomon@google.com> | 2015-01-23 04:24:04 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-01-23 04:24:05 -0800 |
commit | 24db3b1c35fb935660229da164fc5ad31977387f (patch) | |
tree | be22e794f54605ff37ef09df79b3e0869572b053 /src/gpu/effects/GrTextureStripAtlas.cpp | |
parent | f98f2bb0e72df68320f707c8584e3c877ce98ec3 (diff) |
Add specialized content key class for resources.
Review URL: https://codereview.chromium.org/858123002
Diffstat (limited to 'src/gpu/effects/GrTextureStripAtlas.cpp')
-rw-r--r-- | src/gpu/effects/GrTextureStripAtlas.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gpu/effects/GrTextureStripAtlas.cpp b/src/gpu/effects/GrTextureStripAtlas.cpp index 134c99f452..2305586844 100644 --- a/src/gpu/effects/GrTextureStripAtlas.cpp +++ b/src/gpu/effects/GrTextureStripAtlas.cpp @@ -196,15 +196,15 @@ void GrTextureStripAtlas::lockTexture() { texDesc.fHeight = fDesc.fHeight; texDesc.fConfig = fDesc.fConfig; - static const GrCacheID::Domain gTextureStripAtlasDomain = GrCacheID::GenerateDomain(); - GrCacheID::Key key; - *key.fData32 = fCacheKey; - memset(key.fData32 + 1, 0, sizeof(key) - sizeof(uint32_t)); - GrCacheID cacheID(gTextureStripAtlasDomain, key); + static const GrContentKey::Domain kDomain = GrContentKey::GenerateDomain(); + GrContentKey key; + GrContentKey::Builder builder(&key, kDomain, 1); + builder[0] = static_cast<uint32_t>(fCacheKey); + builder.finish(); - fTexture = fDesc.fContext->findAndRefTexture(texDesc, cacheID, ¶ms); + fTexture = fDesc.fContext->findAndRefTexture(texDesc, key, ¶ms); if (NULL == fTexture) { - fTexture = fDesc.fContext->createTexture(¶ms, texDesc, cacheID, NULL, 0); + fTexture = fDesc.fContext->createTexture(¶ms, texDesc, key, NULL, 0); // This is a new texture, so all of our cache info is now invalid this->initLRU(); fKeyTable.rewind(); |