Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(152)

Unified Diff: tests/skbug5221.cpp

Issue 1936073003: When filling nested rect path check for empty inner and empty outer rects (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: rm skpath.h include Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/batches/GrRectBatchFactory.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/skbug5221.cpp
diff --git a/tests/skbug5221.cpp b/tests/skbug5221.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..45847eeac17745efa0fdd401eb97dc8258d43874
--- /dev/null
+++ b/tests/skbug5221.cpp
@@ -0,0 +1,33 @@
+/*
+ * 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 "Test.h"
+#include "SkCanvas.h"
+#include "SkSurface.h"
+
+// This passes by not crashing.
+static void test(SkCanvas* canvas) {
+ SkPaint paint;
+ paint.setAntiAlias(true);
+ canvas->scale(63, 0);
+ static const char kTxt[] = "A";
+ canvas->drawText(kTxt, SK_ARRAY_COUNT(kTxt), 50, 50, paint);
+}
+
+DEF_TEST(skbug5221, r) {
+ sk_sp<SkSurface> surface(SkSurface::MakeRaster(SkImageInfo::MakeN32Premul(256, 256)));
+ test(surface->getCanvas());
+}
+
+#if SK_SUPPORT_GPU
+DEF_GPUTEST_FOR_ALL_CONTEXTS(skbug5221_GPU, r, contextInfo) {
+ sk_sp<SkSurface> surface(SkSurface::MakeRenderTarget(contextInfo.fGrContext, SkBudgeted::kYes,
+ SkImageInfo::MakeN32Premul(256, 256), 0,
+ nullptr));
+ test(surface->getCanvas());
+}
+#endif
« no previous file with comments | « src/gpu/batches/GrRectBatchFactory.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698