Paint_getPosTextPath.cpp 693 B

123456789101112131415161718
  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 "tools/fiddle/examples.h"
  5. // HASH=7f27c93472aa99a7542fb3493076f072
  6. REG_FIDDLE(Paint_getPosTextPath, 256, 85, false, 0) {
  7. void draw(SkCanvas* canvas) {
  8. SkPaint paint;
  9. paint.setTextSize(80);
  10. SkPath path, path2;
  11. SkPoint pos[] = {{20, 60}, {30, 70}, {40, 80}};
  12. paint.getPosTextPath("ABC", 3, pos, &path);
  13. Simplify(path, &path);
  14. paint.setStyle(SkPaint::kStroke_Style);
  15. canvas->drawPath(path, paint);
  16. }
  17. } // END FIDDLE
  18. #endif // Disabled until updated to use current API.