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

Unified Diff: tests/GLProgramsTest.cpp

Issue 882223003: Move npot resizing out of GrContext and simplify GrContext texture functions. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 years, 11 months 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
« no previous file with comments | « src/gpu/effects/GrTextureStripAtlas.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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, &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,
« no previous file with comments | « src/gpu/effects/GrTextureStripAtlas.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698