Hal Canary | 6c8422c | 2020-01-10 15:22:09 -0500 | [diff] [blame] | 1 | // Copyright 2020 Google LLC. |
| 2 | // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. |
| 3 | #include "tools/fiddle/examples.h" |
| 4 | REG_FIDDLE(massive_coordinates_svg, 800, 600, false, 0) { |
| 5 | void draw(SkCanvas* canvas) { |
| 6 | SkPaint paint; |
| 7 | paint.setAntiAlias(true); |
| 8 | |
| 9 | SkRect r = {0, 0, 800, 590}; |
| 10 | paint.setColor(SK_ColorGREEN); |
| 11 | canvas->drawRect(r, paint); |
| 12 | |
| 13 | canvas->clipRect(r); |
| 14 | |
| 15 | paint.setColor(SK_ColorBLACK); |
| 16 | |
| 17 | paint.setStyle(SkPaint::kStroke_Style); |
| 18 | paint.setStrokeWidth(1); |
| 19 | SkPath path; |
| 20 | path.moveTo(-1000, 12345678901234567890.f); |
| 21 | path.lineTo(200, 200); |
| 22 | canvas->drawPath(path, paint); |
| 23 | |
| 24 | path.reset(); |
| 25 | path.moveTo(600, 400); |
| 26 | path.lineTo(1000, -9.8765432109876543210e+19f); |
| 27 | canvas->drawPath(path, paint); |
| 28 | } |
| 29 | } // END FIDDLE |