aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/skbug_4868.cpp
diff options
context:
space:
mode:
authorGravatar halcanary <halcanary@google.com>2016-02-24 15:46:46 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-02-24 15:46:46 -0800
commit8e9f5e39d774198a5a5d9345bc9f863e855c593b (patch)
treeb13c2ed1a24d9791863f254515ecbfaf25927a4c /gm/skbug_4868.cpp
parentfbe355208d6aff6bdf69a1bd41a93852edf692e7 (diff)
SkPDF: fix scalar serialization
Diffstat (limited to 'gm/skbug_4868.cpp')
-rw-r--r--gm/skbug_4868.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/gm/skbug_4868.cpp b/gm/skbug_4868.cpp
new file mode 100644
index 0000000000..4f33715a43
--- /dev/null
+++ b/gm/skbug_4868.cpp
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2016 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "gm.h"
+
+// clipRect and drawLine should line up exactly when they use the same point.
+// When SkPDF rounds large floats, this doesn't always happen.
+DEF_SIMPLE_GM(skbug_4868, canvas, 32, 32) {
+ canvas->translate(-68.0f, -3378.0f);
+ SkPaint paint;
+ paint.setAntiAlias(true);
+ paint.setStyle(SkPaint::kStroke_Style);
+ canvas->scale(0.56692914f, 0.56692914f);
+ SkRect rc = SkRect::MakeLTRB(158.0f, 5994.80273f, 165.0f, 5998.80225f);
+ canvas->clipRect(rc);
+ canvas->clear(0xFFCECFCE);
+ canvas->drawLine(rc.left(), rc.top(), rc.right(), rc.bottom(), paint);
+ canvas->drawLine(rc.right(), rc.top(), rc.left(), rc.bottom(), paint);
+}