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

Unified Diff: src/effects/SkColorCubeFilter.cpp

Issue 695813003: Add class GrGLTextureRenderTarget for GL texture/rendertarget objects (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: forgot to save file Created 6 years, 1 month 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
Index: src/effects/SkColorCubeFilter.cpp
diff --git a/src/effects/SkColorCubeFilter.cpp b/src/effects/SkColorCubeFilter.cpp
index 22425983d1aecbcbb2f03643b3d183f0f3d944c3..d9d6841e50019c4a83d802880afe01a3f0bbc7b6 100644
--- a/src/effects/SkColorCubeFilter.cpp
+++ b/src/effects/SkColorCubeFilter.cpp
@@ -356,11 +356,12 @@ GrFragmentProcessor* SkColorCubeFilter::asFragmentProcessor(GrContext* context)
desc.fHeight = fCache.cubeDimension() * fCache.cubeDimension();
desc.fConfig = kRGBA_8888_GrPixelConfig;
- SkAutoTUnref<GrTexture> textureCube(
- static_cast<GrTexture*>(context->findAndRefCachedResource(
- GrTexturePriv::ComputeKey(context->getGpu(), NULL, desc, cacheID))));
-
- if (!textureCube) {
+ GrResourceKey rkey = GrTexturePriv::ComputeKey(context->getGpu(), NULL, desc, cacheID);
+ GrSurface* surface = static_cast<GrSurface*>(context->findAndRefCachedResource(rkey));
+ SkAutoTUnref<GrTexture> textureCube;
+ if (surface) {
+ textureCube.reset(surface->asTexture());
+ } else {
textureCube.reset(context->createTexture(NULL, desc, cacheID, fCubeData->data(), 0));
}

Powered by Google App Engine
This is Rietveld 408576698