| 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 #if SK_SUPPORT_GPU | 8 #if SK_SUPPORT_GPU |
| 9 #include "GrContextFactory.h" | 9 #include "GrContextFactory.h" |
| 10 #include "GrTessellatingPathRenderer.h" | 10 #include "GrTessellatingPathRenderer.h" |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 path.moveTo(217.326019287109375f, 166.4752960205078125f); | 213 path.moveTo(217.326019287109375f, 166.4752960205078125f); |
| 214 path.lineTo(226.279266357421875f, 170.929473876953125f); | 214 path.lineTo(226.279266357421875f, 170.929473876953125f); |
| 215 path.lineTo(234.3973388671875f, 177.0623626708984375f); | 215 path.lineTo(234.3973388671875f, 177.0623626708984375f); |
| 216 path.lineTo(262.0921630859375f, 188.746124267578125f); | 216 path.lineTo(262.0921630859375f, 188.746124267578125f); |
| 217 path.moveTo(196.23638916015625f, 174.0722198486328125f); | 217 path.moveTo(196.23638916015625f, 174.0722198486328125f); |
| 218 path.lineTo(416.15277099609375f, 180.138214111328125f); | 218 path.lineTo(416.15277099609375f, 180.138214111328125f); |
| 219 path.lineTo(192.651947021484375f, 304.0228271484375f); | 219 path.lineTo(192.651947021484375f, 304.0228271484375f); |
| 220 return path; | 220 return path; |
| 221 } | 221 } |
| 222 | 222 |
| 223 static SkPath create_path_15() { |
| 224 SkPath path; |
| 225 path.moveTo( 0.0f, 0.0f); |
| 226 path.lineTo(10000.0f, 0.0f); |
| 227 path.lineTo( 0.0f, -1.0f); |
| 228 path.lineTo(10000.0f, 0.000001f); |
| 229 path.lineTo( 0.0f, -30.0f); |
| 230 return path; |
| 231 } |
| 232 |
| 223 static void test_path(GrDrawTarget* dt, GrRenderTarget* rt, const SkPath& path)
{ | 233 static void test_path(GrDrawTarget* dt, GrRenderTarget* rt, const SkPath& path)
{ |
| 224 GrTessellatingPathRenderer tess; | 234 GrTessellatingPathRenderer tess; |
| 225 GrPipelineBuilder pipelineBuilder; | 235 GrPipelineBuilder pipelineBuilder; |
| 226 pipelineBuilder.setRenderTarget(rt); | 236 pipelineBuilder.setRenderTarget(rt); |
| 227 SkStrokeRec stroke(SkStrokeRec::kFill_InitStyle); | 237 SkStrokeRec stroke(SkStrokeRec::kFill_InitStyle); |
| 228 tess.drawPath(dt, &pipelineBuilder, SK_ColorWHITE, SkMatrix::I(), path, stro
ke, false); | 238 tess.drawPath(dt, &pipelineBuilder, SK_ColorWHITE, SkMatrix::I(), path, stro
ke, false); |
| 229 } | 239 } |
| 230 | 240 |
| 231 DEF_GPUTEST(TessellatingPathRendererTests, reporter, factory) { | 241 DEF_GPUTEST(TessellatingPathRendererTests, reporter, factory) { |
| 232 GrContext* context = factory->get(static_cast<GrContextFactory::GLContextTyp
e>(0)); | 242 GrContext* context = factory->get(static_cast<GrContextFactory::GLContextTyp
e>(0)); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 252 test_path(dt, rt, create_path_5()); | 262 test_path(dt, rt, create_path_5()); |
| 253 test_path(dt, rt, create_path_6()); | 263 test_path(dt, rt, create_path_6()); |
| 254 test_path(dt, rt, create_path_7()); | 264 test_path(dt, rt, create_path_7()); |
| 255 test_path(dt, rt, create_path_8()); | 265 test_path(dt, rt, create_path_8()); |
| 256 test_path(dt, rt, create_path_9()); | 266 test_path(dt, rt, create_path_9()); |
| 257 test_path(dt, rt, create_path_10()); | 267 test_path(dt, rt, create_path_10()); |
| 258 test_path(dt, rt, create_path_11()); | 268 test_path(dt, rt, create_path_11()); |
| 259 test_path(dt, rt, create_path_12()); | 269 test_path(dt, rt, create_path_12()); |
| 260 test_path(dt, rt, create_path_13()); | 270 test_path(dt, rt, create_path_13()); |
| 261 test_path(dt, rt, create_path_14()); | 271 test_path(dt, rt, create_path_14()); |
| 272 test_path(dt, rt, create_path_15()); |
| 262 } | 273 } |
| 263 #endif | 274 #endif |
| OLD | NEW |