| 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" |
| 9 |
| 8 #if SK_SUPPORT_GPU | 10 #if SK_SUPPORT_GPU |
| 9 #include "GrContextFactory.h" | 11 #include "GrContextFactory.h" |
| 10 #include "GrTessellatingPathRenderer.h" | 12 #include "GrTessellatingPathRenderer.h" |
| 11 #include "GrTest.h" | 13 #include "GrTest.h" |
| 12 #include "Test.h" | 14 #include "Test.h" |
| 13 | 15 |
| 14 /* | 16 /* |
| 15 * These tests pass by not crashing, hanging or asserting in Debug. | 17 * These tests pass by not crashing, hanging or asserting in Debug. |
| 16 */ | 18 */ |
| 17 | 19 |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 static void test_path(GrDrawTarget* dt, GrRenderTarget* rt, const SkPath& path)
{ | 235 static void test_path(GrDrawTarget* dt, GrRenderTarget* rt, const SkPath& path)
{ |
| 234 GrTessellatingPathRenderer tess; | 236 GrTessellatingPathRenderer tess; |
| 235 GrPipelineBuilder pipelineBuilder; | 237 GrPipelineBuilder pipelineBuilder; |
| 236 pipelineBuilder.setRenderTarget(rt); | 238 pipelineBuilder.setRenderTarget(rt); |
| 237 SkStrokeRec stroke(SkStrokeRec::kFill_InitStyle); | 239 SkStrokeRec stroke(SkStrokeRec::kFill_InitStyle); |
| 238 tess.drawPath(dt, &pipelineBuilder, SK_ColorWHITE, SkMatrix::I(), path, stro
ke, false); | 240 tess.drawPath(dt, &pipelineBuilder, SK_ColorWHITE, SkMatrix::I(), path, stro
ke, false); |
| 239 } | 241 } |
| 240 | 242 |
| 241 DEF_GPUTEST(TessellatingPathRendererTests, reporter, factory) { | 243 DEF_GPUTEST(TessellatingPathRendererTests, reporter, factory) { |
| 242 GrContext* context = factory->get(static_cast<GrContextFactory::GLContextTyp
e>(0)); | 244 GrContext* context = factory->get(static_cast<GrContextFactory::GLContextTyp
e>(0)); |
| 245 if (!context) { |
| 246 return; |
| 247 } |
| 243 GrSurfaceDesc desc; | 248 GrSurfaceDesc desc; |
| 244 desc.fFlags = kRenderTarget_GrSurfaceFlag; | 249 desc.fFlags = kRenderTarget_GrSurfaceFlag; |
| 245 desc.fWidth = 800; | 250 desc.fWidth = 800; |
| 246 desc.fHeight = 800; | 251 desc.fHeight = 800; |
| 247 desc.fConfig = kSkia8888_GrPixelConfig; | 252 desc.fConfig = kSkia8888_GrPixelConfig; |
| 248 desc.fOrigin = kTopLeft_GrSurfaceOrigin; | 253 desc.fOrigin = kTopLeft_GrSurfaceOrigin; |
| 249 SkAutoTUnref<GrTexture> texture( | 254 SkAutoTUnref<GrTexture> texture( |
| 250 context->refScratchTexture(desc, GrContext::kExact_ScratchTexMatch) | 255 context->refScratchTexture(desc, GrContext::kExact_ScratchTexMatch) |
| 251 ); | 256 ); |
| 252 GrTestTarget tt; | 257 GrTestTarget tt; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 265 test_path(dt, rt, create_path_8()); | 270 test_path(dt, rt, create_path_8()); |
| 266 test_path(dt, rt, create_path_9()); | 271 test_path(dt, rt, create_path_9()); |
| 267 test_path(dt, rt, create_path_10()); | 272 test_path(dt, rt, create_path_10()); |
| 268 test_path(dt, rt, create_path_11()); | 273 test_path(dt, rt, create_path_11()); |
| 269 test_path(dt, rt, create_path_12()); | 274 test_path(dt, rt, create_path_12()); |
| 270 test_path(dt, rt, create_path_13()); | 275 test_path(dt, rt, create_path_13()); |
| 271 test_path(dt, rt, create_path_14()); | 276 test_path(dt, rt, create_path_14()); |
| 272 test_path(dt, rt, create_path_15()); | 277 test_path(dt, rt, create_path_15()); |
| 273 } | 278 } |
| 274 #endif | 279 #endif |
| OLD | NEW |