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

Unified Diff: src/effects/SkColorCubeFilter.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/effects/SkBlurMaskFilter.cpp ('k') | src/gpu/GrCacheID.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkColorCubeFilter.cpp
diff --git a/src/effects/SkColorCubeFilter.cpp b/src/effects/SkColorCubeFilter.cpp
index 78f8ba3ab7ad7862df2eb5086363415f68357a45..bfe28396ffbb741aab7d669b127f7b6137260a5c 100644
--- a/src/effects/SkColorCubeFilter.cpp
+++ b/src/effects/SkColorCubeFilter.cpp
@@ -342,26 +342,24 @@ void GrColorCubeEffect::GLProcessor::GenKey(const GrProcessor& proc,
}
GrFragmentProcessor* SkColorCubeFilter::asFragmentProcessor(GrContext* context) const {
- static const GrCacheID::Domain gCubeDomain = GrCacheID::GenerateDomain();
-
- GrCacheID::Key key;
- key.fData32[0] = fUniqueID;
- key.fData32[1] = fCache.cubeDimension();
- key.fData64[1] = 0;
- GrCacheID cacheID(gCubeDomain, key);
+ static const GrContentKey::Domain kDomain = GrContentKey::GenerateDomain();
+ GrContentKey key;
+ GrContentKey::Builder builder(&key, kDomain, 2);
+ builder[0] = fUniqueID;
+ builder[1] = fCache.cubeDimension();
+ builder.finish();
GrSurfaceDesc desc;
desc.fWidth = fCache.cubeDimension();
desc.fHeight = fCache.cubeDimension() * fCache.cubeDimension();
desc.fConfig = kRGBA_8888_GrPixelConfig;
- GrResourceKey rkey = GrTexturePriv::ComputeKey(context->getGpu(), NULL, desc, cacheID);
- GrSurface* surface = static_cast<GrSurface*>(context->findAndRefCachedResource(rkey));
+ GrSurface* surface = static_cast<GrSurface*>(context->findAndRefCachedResource(key));
SkAutoTUnref<GrTexture> textureCube;
if (surface) {
textureCube.reset(surface->asTexture());
} else {
- textureCube.reset(context->createTexture(NULL, desc, cacheID, fCubeData->data(), 0));
+ textureCube.reset(context->createTexture(NULL, desc, key, fCubeData->data(), 0));
}
return textureCube ? GrColorCubeEffect::Create(textureCube) : NULL;
« no previous file with comments | « src/effects/SkBlurMaskFilter.cpp ('k') | src/gpu/GrCacheID.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698