Also provides the ResourceProvider to onDrawPath which allows the DF PR to no longer require access to GrContext.
Review URL: https://codereview.chromium.org/1265763002
diff --git a/tests/TessellatingPathRendererTests.cpp b/tests/TessellatingPathRendererTests.cpp
index bc2d0d1..d6d3330 100644
--- a/tests/TessellatingPathRendererTests.cpp
+++ b/tests/TessellatingPathRendererTests.cpp
@@ -232,12 +232,22 @@
return path;
}
-static void test_path(GrDrawTarget* dt, GrRenderTarget* rt, const SkPath& path) {
+static void test_path(GrDrawTarget* dt, GrRenderTarget* rt, GrResourceProvider* rp,
+ const SkPath& path) {
GrTessellatingPathRenderer tess;
GrPipelineBuilder pipelineBuilder;
pipelineBuilder.setRenderTarget(rt);
GrStrokeInfo stroke(SkStrokeRec::kFill_InitStyle);
- tess.drawPath(dt, &pipelineBuilder, SK_ColorWHITE, SkMatrix::I(), path, stroke, false);
+ GrPathRenderer::DrawPathArgs args;
+ args.fTarget = dt;
+ args.fPipelineBuilder = &pipelineBuilder;
+ args.fResourceProvider = rp;
+ args.fColor = GrColor_WHITE;
+ args.fViewMatrix = &SkMatrix::I();
+ args.fPath = &path;
+ args.fStroke = &stroke;
+ args.fAntiAlias = false;
+ tess.drawPath(args);
}
DEF_GPUTEST(TessellatingPathRendererTests, reporter, factory) {
@@ -257,22 +267,23 @@
context->getTestTarget(&tt);
GrRenderTarget* rt = texture->asRenderTarget();
GrDrawTarget* dt = tt.target();
+ GrResourceProvider* rp = tt.resourceProvider();
- test_path(dt, rt, create_path_0());
- test_path(dt, rt, create_path_1());
- test_path(dt, rt, create_path_2());
- test_path(dt, rt, create_path_3());
- test_path(dt, rt, create_path_4());
- test_path(dt, rt, create_path_5());
- test_path(dt, rt, create_path_6());
- test_path(dt, rt, create_path_7());
- test_path(dt, rt, create_path_8());
- test_path(dt, rt, create_path_9());
- test_path(dt, rt, create_path_10());
- test_path(dt, rt, create_path_11());
- test_path(dt, rt, create_path_12());
- test_path(dt, rt, create_path_13());
- test_path(dt, rt, create_path_14());
- test_path(dt, rt, create_path_15());
+ test_path(dt, rt, rp, create_path_0());
+ test_path(dt, rt, rp, create_path_1());
+ test_path(dt, rt, rp, create_path_2());
+ test_path(dt, rt, rp, create_path_3());
+ test_path(dt, rt, rp, create_path_4());
+ test_path(dt, rt, rp, create_path_5());
+ test_path(dt, rt, rp, create_path_6());
+ test_path(dt, rt, rp, create_path_7());
+ test_path(dt, rt, rp, create_path_8());
+ test_path(dt, rt, rp, create_path_9());
+ test_path(dt, rt, rp, create_path_10());
+ test_path(dt, rt, rp, create_path_11());
+ test_path(dt, rt, rp, create_path_12());
+ test_path(dt, rt, rp, create_path_13());
+ test_path(dt, rt, rp, create_path_14());
+ test_path(dt, rt, rp, create_path_15());
}
#endif