| 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 |
| 11 #include "GrContextFactory.h" | 11 #include "GrContext.h" |
| 12 #include "GrTest.h" | 12 #include "GrTest.h" |
| 13 #include "Test.h" | 13 #include "Test.h" |
| 14 #include "batches/GrTessellatingPathRenderer.h" | 14 #include "batches/GrTessellatingPathRenderer.h" |
| 15 | 15 |
| 16 /* | 16 /* |
| 17 * These tests pass by not crashing, hanging or asserting in Debug. | 17 * These tests pass by not crashing, hanging or asserting in Debug. |
| 18 */ | 18 */ |
| 19 | 19 |
| 20 // Tests active edges made inactive by splitting. | 20 // Tests active edges made inactive by splitting. |
| 21 // Also tests active edge list forced into an invalid ordering by | 21 // Also tests active edge list forced into an invalid ordering by |
| (...skipping 223 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(TessellatingPathRendererTests, reporter, factory) { | 255 DEF_GPUTEST_FOR_NATIVE_CONTEXT(TessellatingPathRendererTests, reporter, context)
{ |
| 256 GrContext* context = factory->get(static_cast<GrContextFactory::GLContextTyp
e>(0)); | |
| 257 if (nullptr == context) { | |
| 258 return; | |
| 259 } | |
| 260 GrSurfaceDesc desc; | 256 GrSurfaceDesc desc; |
| 261 desc.fFlags = kRenderTarget_GrSurfaceFlag; | 257 desc.fFlags = kRenderTarget_GrSurfaceFlag; |
| 262 desc.fWidth = 800; | 258 desc.fWidth = 800; |
| 263 desc.fHeight = 800; | 259 desc.fHeight = 800; |
| 264 desc.fConfig = kSkia8888_GrPixelConfig; | 260 desc.fConfig = kSkia8888_GrPixelConfig; |
| 265 desc.fOrigin = kTopLeft_GrSurfaceOrigin; | 261 desc.fOrigin = kTopLeft_GrSurfaceOrigin; |
| 266 SkAutoTUnref<GrTexture> texture(context->textureProvider()->createApproxText
ure(desc)); | 262 SkAutoTUnref<GrTexture> texture(context->textureProvider()->createApproxText
ure(desc)); |
| 267 GrTestTarget tt; | 263 GrTestTarget tt; |
| 268 GrRenderTarget* rt = texture->asRenderTarget(); | 264 GrRenderTarget* rt = texture->asRenderTarget(); |
| 269 context->getTestTarget(&tt, rt); | 265 context->getTestTarget(&tt, rt); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 281 test_path(dt, rt, rp, create_path_8()); | 277 test_path(dt, rt, rp, create_path_8()); |
| 282 test_path(dt, rt, rp, create_path_9()); | 278 test_path(dt, rt, rp, create_path_9()); |
| 283 test_path(dt, rt, rp, create_path_10()); | 279 test_path(dt, rt, rp, create_path_10()); |
| 284 test_path(dt, rt, rp, create_path_11()); | 280 test_path(dt, rt, rp, create_path_11()); |
| 285 test_path(dt, rt, rp, create_path_12()); | 281 test_path(dt, rt, rp, create_path_12()); |
| 286 test_path(dt, rt, rp, create_path_13()); | 282 test_path(dt, rt, rp, create_path_13()); |
| 287 test_path(dt, rt, rp, create_path_14()); | 283 test_path(dt, rt, rp, create_path_14()); |
| 288 test_path(dt, rt, rp, create_path_15()); | 284 test_path(dt, rt, rp, create_path_15()); |
| 289 } | 285 } |
| 290 #endif | 286 #endif |
| OLD | NEW |