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