diff options
author | robertphillips <robertphillips@google.com> | 2016-04-27 13:34:01 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-27 13:34:01 -0700 |
commit | 2f1c42e8448bbbadeb3df1c626faa90aa33f8907 (patch) | |
tree | d5fc271e0eb33e4203617ce852ce79d73444e4fd /tests/PrimitiveProcessorTest.cpp | |
parent | 4eeccc9de7d2381df85d68e0331a40cddf5989b1 (diff) |
Refactor drawContext/RenderTarget creation
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1914883002
Review-Url: https://codereview.chromium.org/1914883002
Diffstat (limited to 'tests/PrimitiveProcessorTest.cpp')
-rw-r--r-- | tests/PrimitiveProcessorTest.cpp | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/tests/PrimitiveProcessorTest.cpp b/tests/PrimitiveProcessorTest.cpp index 6d4ede1ce9..b1157a33a9 100644 --- a/tests/PrimitiveProcessorTest.cpp +++ b/tests/PrimitiveProcessorTest.cpp @@ -103,18 +103,9 @@ private: DEF_GPUTEST_FOR_ALL_GL_CONTEXTS(VertexAttributeCount, reporter, ctxInfo) { GrContext* context = ctxInfo.fGrContext; - GrTextureDesc desc; - desc.fHeight = 1; - desc.fWidth = 1; - desc.fFlags = kRenderTarget_GrSurfaceFlag; - desc.fConfig = kRGBA_8888_GrPixelConfig; - SkAutoTUnref<GrTexture> target(context->textureProvider()->createTexture(desc, - SkBudgeted::kYes)); - if (!target) { - ERRORF(reporter, "Could not create render target."); - return; - } - sk_sp<GrDrawContext> dc(context->drawContext(sk_ref_sp(target->asRenderTarget()))); + + sk_sp<GrDrawContext> dc(context->newDrawContext(GrContext::kLoose_BackingFit, + 1, 1, kRGBA_8888_GrPixelConfig)); if (!dc) { ERRORF(reporter, "Could not create draw context."); return; @@ -132,7 +123,7 @@ DEF_GPUTEST_FOR_ALL_GL_CONTEXTS(VertexAttributeCount, reporter, ctxInfo) { #endif SkAutoTUnref<GrDrawBatch> batch; GrPipelineBuilder pb; - pb.setRenderTarget(target->asRenderTarget()); + pb.setRenderTarget(dc->accessRenderTarget()); // This one should succeed. batch.reset(new Batch(attribCnt)); dc->drawContextPriv().testingOnly_drawBatch(pb, batch); |