halcanary | 8e9f5e3 | 2016-02-24 15:46:46 -0800 | [diff] [blame] | 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 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 8 | #include "gm/gm.h" |
Ben Wagner | 7fde8e1 | 2019-05-01 17:28:53 -0400 | [diff] [blame] | 9 | #include "include/core/SkCanvas.h" |
| 10 | #include "include/core/SkPaint.h" |
| 11 | #include "include/core/SkRect.h" |
halcanary | 8e9f5e3 | 2016-02-24 15:46:46 -0800 | [diff] [blame] | 12 | |
| 13 | // clipRect and drawLine should line up exactly when they use the same point. |
| 14 | // When SkPDF rounds large floats, this doesn't always happen. |
| 15 | DEF_SIMPLE_GM(skbug_4868, canvas, 32, 32) { |
| 16 | canvas->translate(-68.0f, -3378.0f); |
| 17 | SkPaint paint; |
| 18 | paint.setAntiAlias(true); |
| 19 | paint.setStyle(SkPaint::kStroke_Style); |
| 20 | canvas->scale(0.56692914f, 0.56692914f); |
| 21 | SkRect rc = SkRect::MakeLTRB(158.0f, 5994.80273f, 165.0f, 5998.80225f); |
| 22 | canvas->clipRect(rc); |
| 23 | canvas->clear(0xFFCECFCE); |
| 24 | canvas->drawLine(rc.left(), rc.top(), rc.right(), rc.bottom(), paint); |
| 25 | canvas->drawLine(rc.right(), rc.top(), rc.left(), rc.bottom(), paint); |
| 26 | } |