OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkPath.h" | 8 #include "SkPath.h" |
9 | 9 |
10 #if SK_SUPPORT_GPU | 10 #if SK_SUPPORT_GPU |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 return path; | 232 return path; |
233 } | 233 } |
234 | 234 |
235 static void test_path(GrDrawTarget* dt, GrRenderTarget* rt, GrResourceProvider*
rp, | 235 static void test_path(GrDrawTarget* dt, GrRenderTarget* rt, GrResourceProvider*
rp, |
236 const SkPath& path) { | 236 const SkPath& path) { |
237 GrTessellatingPathRenderer tess; | 237 GrTessellatingPathRenderer tess; |
238 GrPipelineBuilder pipelineBuilder; | 238 GrPipelineBuilder pipelineBuilder; |
239 pipelineBuilder.setXPFactory( | 239 pipelineBuilder.setXPFactory( |
240 GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode))->unref(); | 240 GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode))->unref(); |
241 pipelineBuilder.setRenderTarget(rt); | 241 pipelineBuilder.setRenderTarget(rt); |
| 242 GrNoClip noClip; |
242 GrStyle style(SkStrokeRec::kFill_InitStyle); | 243 GrStyle style(SkStrokeRec::kFill_InitStyle); |
243 GrPathRenderer::DrawPathArgs args; | 244 GrPathRenderer::DrawPathArgs args; |
244 args.fTarget = dt; | 245 args.fTarget = dt; |
245 args.fPipelineBuilder = &pipelineBuilder; | 246 args.fPipelineBuilder = &pipelineBuilder; |
246 args.fClip = &GrClip::WideOpen(); | 247 args.fClip = &noClip; |
247 args.fResourceProvider = rp; | 248 args.fResourceProvider = rp; |
248 args.fColor = GrColor_WHITE; | 249 args.fColor = GrColor_WHITE; |
249 args.fViewMatrix = &SkMatrix::I(); | 250 args.fViewMatrix = &SkMatrix::I(); |
250 args.fPath = &path; | 251 args.fPath = &path; |
251 args.fStyle = &style; | 252 args.fStyle = &style; |
252 args.fAntiAlias = false; | 253 args.fAntiAlias = false; |
253 tess.drawPath(args); | 254 tess.drawPath(args); |
254 } | 255 } |
255 | 256 |
256 DEF_GPUTEST_FOR_ALL_CONTEXTS(TessellatingPathRendererTests, reporter, ctxInfo) { | 257 DEF_GPUTEST_FOR_ALL_CONTEXTS(TessellatingPathRendererTests, reporter, ctxInfo) { |
(...skipping 22 matching lines...) Expand all Loading... |
279 test_path(dt, rt, rp, create_path_8()); | 280 test_path(dt, rt, rp, create_path_8()); |
280 test_path(dt, rt, rp, create_path_9()); | 281 test_path(dt, rt, rp, create_path_9()); |
281 test_path(dt, rt, rp, create_path_10()); | 282 test_path(dt, rt, rp, create_path_10()); |
282 test_path(dt, rt, rp, create_path_11()); | 283 test_path(dt, rt, rp, create_path_11()); |
283 test_path(dt, rt, rp, create_path_12()); | 284 test_path(dt, rt, rp, create_path_12()); |
284 test_path(dt, rt, rp, create_path_13()); | 285 test_path(dt, rt, rp, create_path_13()); |
285 test_path(dt, rt, rp, create_path_14()); | 286 test_path(dt, rt, rp, create_path_14()); |
286 test_path(dt, rt, rp, create_path_15()); | 287 test_path(dt, rt, rp, create_path_15()); |
287 } | 288 } |
288 #endif | 289 #endif |
OLD | NEW |