skbug_4868.cpp 916 B

1234567891011121314151617181920212223242526
  1. /*
  2. * Copyright 2016 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/SkPaint.h"
  10. #include "include/core/SkRect.h"
  11. // clipRect and drawLine should line up exactly when they use the same point.
  12. // When SkPDF rounds large floats, this doesn't always happen.
  13. DEF_SIMPLE_GM(skbug_4868, canvas, 32, 32) {
  14. canvas->translate(-68.0f, -3378.0f);
  15. SkPaint paint;
  16. paint.setAntiAlias(true);
  17. paint.setStyle(SkPaint::kStroke_Style);
  18. canvas->scale(0.56692914f, 0.56692914f);
  19. SkRect rc = SkRect::MakeLTRB(158.0f, 5994.80273f, 165.0f, 5998.80225f);
  20. canvas->clipRect(rc);
  21. canvas->clear(0xFFCECFCE);
  22. canvas->drawLine(rc.left(), rc.top(), rc.right(), rc.bottom(), paint);
  23. canvas->drawLine(rc.right(), rc.top(), rc.left(), rc.bottom(), paint);
  24. }