crbug_946965.cpp 836 B

123456789101112131415161718192021222324252627
  1. /*
  2. * Copyright 2019 Google LLC
  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/SkPaint.h"
  10. #include "include/core/SkRRect.h"
  11. #include "include/core/SkRect.h"
  12. // Exposed a bug in ellipse rendering where the radii were wrong under 90 degree rotation.
  13. DEF_SIMPLE_GM(crbug_946965, canvas, 75, 150) {
  14. SkPaint paint;
  15. paint.setAntiAlias(true);
  16. canvas->translate(25, 80);
  17. canvas->rotate(90.f);
  18. canvas->scale(1.5, 1);
  19. SkRRect rrect = SkRRect::MakeRectXY(SkRect::MakeLTRB(-20, -5, 20, 5), 10, 10);
  20. canvas->drawRRect(rrect, paint);
  21. canvas->translate(0, -20);
  22. paint.setStrokeWidth(3.f);
  23. paint.setStyle(SkPaint::kStroke_Style);
  24. canvas->drawRRect(rrect, paint);
  25. }