| 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 "SkPreConfig.h" |
| 9 |
| 8 #if SK_SUPPORT_GPU | 10 #if SK_SUPPORT_GPU |
| 9 #include "GrContextFactory.h" | 11 #include "GrContextFactory.h" |
| 12 #include "GrStrokeInfo.h" |
| 10 #include "GrTessellatingPathRenderer.h" | 13 #include "GrTessellatingPathRenderer.h" |
| 11 #include "GrTest.h" | 14 #include "GrTest.h" |
| 12 #include "Test.h" | 15 #include "Test.h" |
| 13 | 16 |
| 14 /* | 17 /* |
| 15 * These tests pass by not crashing, hanging or asserting in Debug. | 18 * These tests pass by not crashing, hanging or asserting in Debug. |
| 16 */ | 19 */ |
| 17 | 20 |
| 18 // Tests active edges made inactive by splitting. | 21 // Tests active edges made inactive by splitting. |
| 19 // Also tests active edge list forced into an invalid ordering by | 22 // Also tests active edge list forced into an invalid ordering by |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 path.lineTo( 0.0f, -1.0f); | 230 path.lineTo( 0.0f, -1.0f); |
| 228 path.lineTo(10000.0f, 0.000001f); | 231 path.lineTo(10000.0f, 0.000001f); |
| 229 path.lineTo( 0.0f, -30.0f); | 232 path.lineTo( 0.0f, -30.0f); |
| 230 return path; | 233 return path; |
| 231 } | 234 } |
| 232 | 235 |
| 233 static void test_path(GrDrawTarget* dt, GrRenderTarget* rt, const SkPath& path)
{ | 236 static void test_path(GrDrawTarget* dt, GrRenderTarget* rt, const SkPath& path)
{ |
| 234 GrTessellatingPathRenderer tess; | 237 GrTessellatingPathRenderer tess; |
| 235 GrPipelineBuilder pipelineBuilder; | 238 GrPipelineBuilder pipelineBuilder; |
| 236 pipelineBuilder.setRenderTarget(rt); | 239 pipelineBuilder.setRenderTarget(rt); |
| 237 SkStrokeRec stroke(SkStrokeRec::kFill_InitStyle); | 240 GrStrokeInfo stroke(SkStrokeRec::kFill_InitStyle); |
| 238 tess.drawPath(dt, &pipelineBuilder, SK_ColorWHITE, SkMatrix::I(), path, stro
ke, false); | 241 tess.drawPath(dt, &pipelineBuilder, SK_ColorWHITE, SkMatrix::I(), path, stro
ke, false); |
| 239 } | 242 } |
| 240 | 243 |
| 241 DEF_GPUTEST(TessellatingPathRendererTests, reporter, factory) { | 244 DEF_GPUTEST(TessellatingPathRendererTests, reporter, factory) { |
| 242 GrContext* context = factory->get(static_cast<GrContextFactory::GLContextTyp
e>(0)); | 245 GrContext* context = factory->get(static_cast<GrContextFactory::GLContextTyp
e>(0)); |
| 243 GrSurfaceDesc desc; | 246 GrSurfaceDesc desc; |
| 244 desc.fFlags = kRenderTarget_GrSurfaceFlag; | 247 desc.fFlags = kRenderTarget_GrSurfaceFlag; |
| 245 desc.fWidth = 800; | 248 desc.fWidth = 800; |
| 246 desc.fHeight = 800; | 249 desc.fHeight = 800; |
| 247 desc.fConfig = kSkia8888_GrPixelConfig; | 250 desc.fConfig = kSkia8888_GrPixelConfig; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 265 test_path(dt, rt, create_path_8()); | 268 test_path(dt, rt, create_path_8()); |
| 266 test_path(dt, rt, create_path_9()); | 269 test_path(dt, rt, create_path_9()); |
| 267 test_path(dt, rt, create_path_10()); | 270 test_path(dt, rt, create_path_10()); |
| 268 test_path(dt, rt, create_path_11()); | 271 test_path(dt, rt, create_path_11()); |
| 269 test_path(dt, rt, create_path_12()); | 272 test_path(dt, rt, create_path_12()); |
| 270 test_path(dt, rt, create_path_13()); | 273 test_path(dt, rt, create_path_13()); |
| 271 test_path(dt, rt, create_path_14()); | 274 test_path(dt, rt, create_path_14()); |
| 272 test_path(dt, rt, create_path_15()); | 275 test_path(dt, rt, create_path_15()); |
| 273 } | 276 } |
| 274 #endif | 277 #endif |
| OLD | NEW |