diff options
author | robertphillips <robertphillips@google.com> | 2016-04-28 06:21:55 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-28 06:21:55 -0700 |
commit | aa19a5fbc58e372df11443c90a25f02a04ecef52 (patch) | |
tree | 4c6f03988d11d06477e9cedae7fda5d44dfcc650 /tests/PrimitiveProcessorTest.cpp | |
parent | b8498825b54718cdd90c30c39323cfc433695f23 (diff) |
Revert of Refactor drawContext/RenderTarget creation (patchset #8 id:140001 of https://codereview.chromium.org/1914883002/ )
Reason for revert:
Experimental revert to see if this is blocking the DEPS roll.
Original issue's description:
> Refactor drawContext/RenderTarget creation
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1914883002
>
> Committed: https://skia.googlesource.com/skia/+/2f1c42e8448bbbadeb3df1c626faa90aa33f8907
TBR=bsalomon@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Review-Url: https://codereview.chromium.org/1929833004
Diffstat (limited to 'tests/PrimitiveProcessorTest.cpp')
-rw-r--r-- | tests/PrimitiveProcessorTest.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/tests/PrimitiveProcessorTest.cpp b/tests/PrimitiveProcessorTest.cpp index b1157a33a9..6d4ede1ce9 100644 --- a/tests/PrimitiveProcessorTest.cpp +++ b/tests/PrimitiveProcessorTest.cpp @@ -103,9 +103,18 @@ private: DEF_GPUTEST_FOR_ALL_GL_CONTEXTS(VertexAttributeCount, reporter, ctxInfo) { GrContext* context = ctxInfo.fGrContext; - - sk_sp<GrDrawContext> dc(context->newDrawContext(GrContext::kLoose_BackingFit, - 1, 1, kRGBA_8888_GrPixelConfig)); + 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()))); if (!dc) { ERRORF(reporter, "Could not create draw context."); return; @@ -123,7 +132,7 @@ DEF_GPUTEST_FOR_ALL_GL_CONTEXTS(VertexAttributeCount, reporter, ctxInfo) { #endif SkAutoTUnref<GrDrawBatch> batch; GrPipelineBuilder pb; - pb.setRenderTarget(dc->accessRenderTarget()); + pb.setRenderTarget(target->asRenderTarget()); // This one should succeed. batch.reset(new Batch(attribCnt)); dc->drawContextPriv().testingOnly_drawBatch(pb, batch); |