Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(292)

Unified Diff: src/gpu/effects/GrTextureStripAtlas.cpp

Issue 858123002: Add specialized content key class for resources. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove default template arg Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/SkGr.cpp ('k') | tests/GLProgramsTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrTextureStripAtlas.cpp
diff --git a/src/gpu/effects/GrTextureStripAtlas.cpp b/src/gpu/effects/GrTextureStripAtlas.cpp
index 134c99f4527e36327e14ad9e4cbd7d9b7020111a..230558684409a0afdc65b8939c18ddee9920c40d 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, &params);
+ fTexture = fDesc.fContext->findAndRefTexture(texDesc, key, &params);
if (NULL == fTexture) {
- fTexture = fDesc.fContext->createTexture(&params, texDesc, cacheID, NULL, 0);
+ fTexture = fDesc.fContext->createTexture(&params, texDesc, key, NULL, 0);
// This is a new texture, so all of our cache info is now invalid
this->initLRU();
fKeyTable.rewind();
« no previous file with comments | « src/gpu/SkGr.cpp ('k') | tests/GLProgramsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698