diff options
author | bsalomon <bsalomon@google.com> | 2016-07-19 08:38:04 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-07-19 08:38:04 -0700 |
commit | 28b62e6672e59957fc9c5c85c87cb65d8bbb44df (patch) | |
tree | 5be61fa987ac6bc97bd39f600138dc8abf58f83e | |
parent | 7f3ff208435e32f105174b37791d4c88ee1072fd (diff) |
Simplify random_draw_context used by GLProgramsTest
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2165683002
Review-Url: https://codereview.chromium.org/2165683002
-rw-r--r-- | tests/GLProgramsTest.cpp | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp index 171ed61316..16a2592078 100644 --- a/tests/GLProgramsTest.cpp +++ b/tests/GLProgramsTest.cpp @@ -154,33 +154,12 @@ static sk_sp<GrDrawContext> random_draw_context(GrContext* context, : kBottomLeft_GrSurfaceOrigin; int sampleCnt = random->nextBool() ? SkTMin(4, caps->maxSampleCount()) : 0; - GrUniqueKey key; - static const GrUniqueKey::Domain kDomain = GrUniqueKey::GenerateDomain(); - GrUniqueKey::Builder builder(&key, kDomain, 2); - builder[0] = origin; - builder[1] = sampleCnt; - builder.finish(); - - sk_sp<GrTexture> texture(context->textureProvider()->findAndRefTextureByUniqueKey(key)); - if (texture) { - sk_sp<GrRenderTarget> rt(sk_ref_sp(texture->asRenderTarget())); - return context->drawContext(std::move(rt)); - } - sk_sp<GrDrawContext> drawContext(context->newDrawContext(SkBackingFit::kExact, kRenderTargetWidth, kRenderTargetHeight, kRGBA_8888_GrPixelConfig, sampleCnt, origin)); - if (!drawContext) { - return nullptr; - } - - // TODO: need a real way to do this via the drawContext - texture = drawContext->asTexture(); - context->textureProvider()->assignUniqueKeyToTexture(key, texture.get()); - return drawContext; } |