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

Unified Diff: src/effects/SkColorCubeFilter.cpp

Issue 868233005: Revert of Move npot resizing out of GrContext and simplify GrContext texture functions. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/GrContext.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 f4ffefc8891284f9e6eec28997b6de57b1c16c75..bfe28396ffbb741aab7d669b127f7b6137260a5c 100644
--- a/src/effects/SkColorCubeFilter.cpp
+++ b/src/effects/SkColorCubeFilter.cpp
@@ -354,12 +354,12 @@
desc.fHeight = fCache.cubeDimension() * fCache.cubeDimension();
desc.fConfig = kRGBA_8888_GrPixelConfig;
- SkAutoTUnref<GrTexture> textureCube(context->findAndRefCachedTexture(key));
- if (!textureCube) {
- textureCube.reset(context->createTexture(desc, fCubeData->data(), 0));
- if (textureCube) {
- SkAssertResult(context->addResourceToCache(key, textureCube));
- }
+ GrSurface* surface = static_cast<GrSurface*>(context->findAndRefCachedResource(key));
+ SkAutoTUnref<GrTexture> textureCube;
+ if (surface) {
+ textureCube.reset(surface->asTexture());
+ } else {
+ 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/GrContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698