smallarc.cpp 867 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * Copyright 2014 Google Inc.
  3. *
  4. * Use of this source code is governed by a BSD-style license that can be
  5. * found in the LICENSE file.
  6. */
  7. #include "gm/gm.h"
  8. #include "include/core/SkCanvas.h"
  9. #include "include/core/SkColor.h"
  10. #include "include/core/SkPaint.h"
  11. #include "include/core/SkPath.h"
  12. // this draws a small arc scaled up
  13. // see https://code.google.com/p/chromium/issues/detail?id=102411
  14. // and https://code.google.com/p/skia/issues/detail?id=2769
  15. DEF_SIMPLE_GM(smallarc, canvas, 762, 762) {
  16. SkPaint p;
  17. p.setColor(SK_ColorRED);
  18. p.setAntiAlias(true);
  19. p.setStyle(SkPaint::kStroke_Style);
  20. p.setStrokeWidth(120);
  21. SkPath path;
  22. path.moveTo(75, 0);
  23. path.cubicTo(33.5, 0, 0, 33.5, 0, 75);
  24. canvas->translate(-400, -400);
  25. canvas->scale(8, 8);
  26. canvas->drawPath(path, p);
  27. }