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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 args.fPipelineBuilder = &pipelineBuilder; | 245 args.fPipelineBuilder = &pipelineBuilder; |
246 args.fResourceProvider = rp; | 246 args.fResourceProvider = rp; |
247 args.fColor = GrColor_WHITE; | 247 args.fColor = GrColor_WHITE; |
248 args.fViewMatrix = &SkMatrix::I(); | 248 args.fViewMatrix = &SkMatrix::I(); |
249 args.fPath = &path; | 249 args.fPath = &path; |
250 args.fStroke = &stroke; | 250 args.fStroke = &stroke; |
251 args.fAntiAlias = false; | 251 args.fAntiAlias = false; |
252 tess.drawPath(args); | 252 tess.drawPath(args); |
253 } | 253 } |
254 | 254 |
255 DEF_GPUTEST_FOR_ALL_CONTEXTS(TessellatingPathRendererTests, reporter, context) { | 255 DEF_GPUTEST_FOR_ALL_CONTEXTS(TessellatingPathRendererTests, reporter, ctxInfo) { |
256 GrSurfaceDesc desc; | 256 GrSurfaceDesc desc; |
257 desc.fFlags = kRenderTarget_GrSurfaceFlag; | 257 desc.fFlags = kRenderTarget_GrSurfaceFlag; |
258 desc.fWidth = 800; | 258 desc.fWidth = 800; |
259 desc.fHeight = 800; | 259 desc.fHeight = 800; |
260 desc.fConfig = kSkia8888_GrPixelConfig; | 260 desc.fConfig = kSkia8888_GrPixelConfig; |
261 desc.fOrigin = kTopLeft_GrSurfaceOrigin; | 261 desc.fOrigin = kTopLeft_GrSurfaceOrigin; |
262 SkAutoTUnref<GrTexture> texture(context->textureProvider()->createApproxText
ure(desc)); | 262 SkAutoTUnref<GrTexture> texture( |
| 263 ctxInfo.fGrContext->textureProvider()->createApproxTexture(desc)); |
263 GrTestTarget tt; | 264 GrTestTarget tt; |
264 GrRenderTarget* rt = texture->asRenderTarget(); | 265 GrRenderTarget* rt = texture->asRenderTarget(); |
265 context->getTestTarget(&tt, rt); | 266 ctxInfo.fGrContext->getTestTarget(&tt, rt); |
266 GrDrawTarget* dt = tt.target(); | 267 GrDrawTarget* dt = tt.target(); |
267 GrResourceProvider* rp = tt.resourceProvider(); | 268 GrResourceProvider* rp = tt.resourceProvider(); |
268 | 269 |
269 test_path(dt, rt, rp, create_path_0()); | 270 test_path(dt, rt, rp, create_path_0()); |
270 test_path(dt, rt, rp, create_path_1()); | 271 test_path(dt, rt, rp, create_path_1()); |
271 test_path(dt, rt, rp, create_path_2()); | 272 test_path(dt, rt, rp, create_path_2()); |
272 test_path(dt, rt, rp, create_path_3()); | 273 test_path(dt, rt, rp, create_path_3()); |
273 test_path(dt, rt, rp, create_path_4()); | 274 test_path(dt, rt, rp, create_path_4()); |
274 test_path(dt, rt, rp, create_path_5()); | 275 test_path(dt, rt, rp, create_path_5()); |
275 test_path(dt, rt, rp, create_path_6()); | 276 test_path(dt, rt, rp, create_path_6()); |
276 test_path(dt, rt, rp, create_path_7()); | 277 test_path(dt, rt, rp, create_path_7()); |
277 test_path(dt, rt, rp, create_path_8()); | 278 test_path(dt, rt, rp, create_path_8()); |
278 test_path(dt, rt, rp, create_path_9()); | 279 test_path(dt, rt, rp, create_path_9()); |
279 test_path(dt, rt, rp, create_path_10()); | 280 test_path(dt, rt, rp, create_path_10()); |
280 test_path(dt, rt, rp, create_path_11()); | 281 test_path(dt, rt, rp, create_path_11()); |
281 test_path(dt, rt, rp, create_path_12()); | 282 test_path(dt, rt, rp, create_path_12()); |
282 test_path(dt, rt, rp, create_path_13()); | 283 test_path(dt, rt, rp, create_path_13()); |
283 test_path(dt, rt, rp, create_path_14()); | 284 test_path(dt, rt, rp, create_path_14()); |
284 test_path(dt, rt, rp, create_path_15()); | 285 test_path(dt, rt, rp, create_path_15()); |
285 } | 286 } |
286 #endif | 287 #endif |
OLD | NEW |