aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2015-02-02 13:00:10 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-02-02 13:00:10 -0800
commit37f9a2694c15f08e361ebda74fe9f0fffbf452aa (patch)
tree2bbbb36f91b31cc203fa375939ab2d4a4a5117f0 /tests
parent52edc4d05380c88de5b334479ad8e537ef2b4925 (diff)
Move npot resizing out of GrContext and simplify GrContext texture functions.
Diffstat (limited to 'tests')
-rw-r--r--tests/GLProgramsTest.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp
index c3752c48bb..16d44fd9df 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, &params));
+ GrTexture* texture = context->findAndRefCachedTexture(key);
if (!texture) {
- texture.reset(context->createTexture(&params, 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,