diff options
| author | bsalomon <bsalomon@google.com> | 2015-01-31 19:27:53 -0800 |
|---|---|---|
| committer | Commit bot <commit-bot@chromium.org> | 2015-01-31 19:27:53 -0800 |
| commit | 6c96672491b04cb782bce8fee778124df66524a0 (patch) | |
| tree | 49407e533766dad8d3fae3c5794afc4536a79098 /tests/GLProgramsTest.cpp | |
| parent | 0b737c52a7b8bc6ba41d309e88b3f7e995746f8d (diff) | |
Move npot resizing out of GrContext and simplify GrContext texture functions.
Committed: https://skia.googlesource.com/skia/+/8a8100349105c8c6de39fcb34e47679da7a67f54
Review URL: https://codereview.chromium.org/882223003
Diffstat (limited to 'tests/GLProgramsTest.cpp')
| -rw-r--r-- | tests/GLProgramsTest.cpp | 10 |
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, ¶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, |
