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