Chromium Code Reviews| Index: tests/skbug5221.cpp |
| diff --git a/tests/skbug5221.cpp b/tests/skbug5221.cpp |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..b37a39f3ab239fc13e655b3047a194a26016d8dc |
| --- /dev/null |
| +++ b/tests/skbug5221.cpp |
| @@ -0,0 +1,34 @@ |
| +/* |
| + * 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" |
|
robertphillips
2016/05/02 19:53:12
Can we rm SkPath.h now ?
bsalomon
2016/05/02 19:57:54
indeed
|
| +#include "SkPath.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 |