Index: tests/GLProgramsTest.cpp |
diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp |
index c3752c48bb7b13be59b6da6e7d5b1d85b5019f94..16d44fd9df1e852cce8cecae8b9e6c2a647f3968 100644 |
--- a/tests/GLProgramsTest.cpp |
+++ b/tests/GLProgramsTest.cpp |
@@ -114,14 +114,14 @@ static GrRenderTarget* random_render_target(GrContext* context, SkRandom* random |
builder[0] = texDesc.fOrigin; |
builder.finish(); |
- SkAutoTUnref<GrTexture> texture(context->findAndRefTexture(texDesc, key, ¶ms)); |
+ GrTexture* texture = context->findAndRefCachedTexture(key); |
if (!texture) { |
- texture.reset(context->createTexture(¶ms, texDesc, key, 0, 0)); |
- if (!texture) { |
- return NULL; |
+ texture = context->createTexture(texDesc); |
+ if (texture) { |
+ SkAssertResult(context->addResourceToCache(key, texture)); |
} |
} |
- return SkRef(texture->asRenderTarget()); |
+ return texture ? texture->asRenderTarget() : NULL; |
} |
static void set_random_xpf(GrContext* context, const GrDrawTargetCaps& caps, |