diff options
author | Robert Phillips <robertphillips@google.com> | 2017-03-01 14:32:46 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-03-02 12:29:16 +0000 |
commit | 256c37bc9ea2a0420b8ac1084f6d645aaeb919f0 (patch) | |
tree | 27c6ec1766362477c7d50292c6cbc1f54757bdb9 /tests/TessellatingPathRendererTests.cpp | |
parent | 9c10df3b60f4a7d50c1070a5d8c4aaadb79ba9b7 (diff) |
Remove atlas creation from GrResourceProvider
This is pulled out of: https://skia-review.googlesource.com/c/6680/ (Make SkImage_Gpu be deferred) and is only tangentially related to the goal of that CL.
Change-Id: I6b6db4869597070f85ab3b9fea178fc88c104f87
Reviewed-on: https://skia-review.googlesource.com/9106
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'tests/TessellatingPathRendererTests.cpp')
-rw-r--r-- | tests/TessellatingPathRendererTests.cpp | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/tests/TessellatingPathRendererTests.cpp b/tests/TessellatingPathRendererTests.cpp index f429df363d..548be4b3a5 100644 --- a/tests/TessellatingPathRendererTests.cpp +++ b/tests/TessellatingPathRendererTests.cpp @@ -270,7 +270,7 @@ static sk_sp<GrFragmentProcessor> create_linear_gradient_processor(GrContext* ct return shader->asFragmentProcessor(args); } -static void test_path(GrResourceProvider* rp, +static void test_path(GrContext* ctx, GrRenderTargetContext* renderTargetContext, const SkPath& path, const SkMatrix& matrix = SkMatrix::I(), @@ -287,7 +287,7 @@ static void test_path(GrResourceProvider* rp, GrNoClip noClip; GrStyle style(SkStrokeRec::kFill_InitStyle); GrShape shape(path, style); - GrPathRenderer::DrawPathArgs args{rp, + GrPathRenderer::DrawPathArgs args{ctx, std::move(paint), &GrUserStencilSettings::kUnused, renderTargetContext, @@ -301,6 +301,7 @@ static void test_path(GrResourceProvider* rp, DEF_GPUTEST_FOR_ALL_CONTEXTS(TessellatingPathRendererTests, reporter, ctxInfo) { GrContext* ctx = ctxInfo.grContext(); + sk_sp<GrRenderTargetContext> rtc(ctx->makeRenderTargetContext(SkBackingFit::kApprox, 800, 800, kRGBA_8888_GrPixelConfig, @@ -311,28 +312,26 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(TessellatingPathRendererTests, reporter, ctxInfo) { return; } - GrResourceProvider* rp = ctx->resourceProvider(); - ctx->flush(); - test_path(rp, rtc.get(), create_path_0()); - test_path(rp, rtc.get(), create_path_1()); - test_path(rp, rtc.get(), create_path_2()); - test_path(rp, rtc.get(), create_path_3()); - test_path(rp, rtc.get(), create_path_4()); - test_path(rp, rtc.get(), create_path_5()); - test_path(rp, rtc.get(), create_path_6()); - test_path(rp, rtc.get(), create_path_7()); - test_path(rp, rtc.get(), create_path_8()); - test_path(rp, rtc.get(), create_path_9()); - test_path(rp, rtc.get(), create_path_10()); - test_path(rp, rtc.get(), create_path_11()); - test_path(rp, rtc.get(), create_path_12()); - test_path(rp, rtc.get(), create_path_13()); - test_path(rp, rtc.get(), create_path_14()); - test_path(rp, rtc.get(), create_path_15()); - test_path(rp, rtc.get(), create_path_16()); + test_path(ctx, rtc.get(), create_path_0()); + test_path(ctx, rtc.get(), create_path_1()); + test_path(ctx, rtc.get(), create_path_2()); + test_path(ctx, rtc.get(), create_path_3()); + test_path(ctx, rtc.get(), create_path_4()); + test_path(ctx, rtc.get(), create_path_5()); + test_path(ctx, rtc.get(), create_path_6()); + test_path(ctx, rtc.get(), create_path_7()); + test_path(ctx, rtc.get(), create_path_8()); + test_path(ctx, rtc.get(), create_path_9()); + test_path(ctx, rtc.get(), create_path_10()); + test_path(ctx, rtc.get(), create_path_11()); + test_path(ctx, rtc.get(), create_path_12()); + test_path(ctx, rtc.get(), create_path_13()); + test_path(ctx, rtc.get(), create_path_14()); + test_path(ctx, rtc.get(), create_path_15()); + test_path(ctx, rtc.get(), create_path_16()); SkMatrix nonInvertibleMatrix = SkMatrix::MakeScale(0, 0); sk_sp<GrFragmentProcessor> fp(create_linear_gradient_processor(ctx)); - test_path(rp, rtc.get(), create_path_17(), nonInvertibleMatrix, GrAAType::kCoverage, fp); + test_path(ctx, rtc.get(), create_path_17(), nonInvertibleMatrix, GrAAType::kCoverage, fp); } #endif |