diff options
author | bsalomon <bsalomon@google.com> | 2016-05-02 13:22:13 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-02 13:22:13 -0700 |
commit | 40ef48580b8bd47355ccf05e43d8032c10a77bbe (patch) | |
tree | 7881c639eaa21ee0f72fec85c26dfbe33013a488 /tests/skbug5221.cpp | |
parent | 6536ae590e3873694cb02cf25dab8001a71f269e (diff) |
When filling nested rect path check for empty inner and empty outer rects
BUG=skia:5221
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1936073003
Review-Url: https://codereview.chromium.org/1936073003
Diffstat (limited to 'tests/skbug5221.cpp')
-rw-r--r-- | tests/skbug5221.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/skbug5221.cpp b/tests/skbug5221.cpp new file mode 100644 index 0000000000..45847eeac1 --- /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 |