Hal Canary | 83c2f70 | 2019-03-07 14:53:03 -0500 | [diff] [blame] | 1 | #if 0 // Disabled until updated to use current API. |
| 2 | // Copyright 2019 Google LLC. |
| 3 | // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. |
| 4 | #include "fiddle/examples.h" |
| 5 | // HASH=888edd4c4a91ca62ceb01bce8ab675b2 |
| 6 | REG_FIDDLE(Path_092, 256, 256, false, 0) { |
| 7 | void draw(SkCanvas* canvas) { |
| 8 | SkPaint paint; |
| 9 | paint.setAntiAlias(true); |
| 10 | SkRRect rrect; |
| 11 | rrect.setRectXY({40, 40, 215, 215}, 50, 50); |
| 12 | SkPath path; |
| 13 | path.addRRect(rrect); |
| 14 | canvas->drawPath(path, paint); |
| 15 | for (int start = 0; start < 8; ++start) { |
| 16 | SkPath textPath; |
| 17 | textPath.addRRect(rrect, SkPath::kCW_Direction, start); |
| 18 | SkPathMeasure pathMeasure(textPath, false); |
| 19 | SkPoint position; |
| 20 | SkVector tangent; |
| 21 | if (!pathMeasure.getPosTan(0, &position, &tangent)) { |
| 22 | continue; |
| 23 | } |
| 24 | SkRSXform rsxForm = SkRSXform::Make(tangent.fX, tangent.fY, |
| 25 | position.fX + tangent.fY * 5, position.fY - tangent.fX * 5); |
| 26 | canvas->drawTextRSXform(&"01234567"[start], 1, &rsxForm, nullptr, paint); |
| 27 | } |
| 28 | } |
| 29 | } // END FIDDLE |
| 30 | #endif // Disabled until updated to use current API. |