2016-05-02 20:22:13 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2016 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
2019-04-23 17:05:21 +00:00
|
|
|
#include "tests/Test.h"
|
2019-01-08 20:04:23 +00:00
|
|
|
|
2019-04-23 17:05:21 +00:00
|
|
|
#include "include/core/SkCanvas.h"
|
|
|
|
#include "include/core/SkFont.h"
|
|
|
|
#include "include/core/SkSurface.h"
|
2020-07-06 14:56:46 +00:00
|
|
|
#include "include/gpu/GrDirectContext.h"
|
2016-05-02 20:22:13 +00:00
|
|
|
|
|
|
|
// This passes by not crashing.
|
|
|
|
static void test(SkCanvas* canvas) {
|
|
|
|
canvas->scale(63, 0);
|
2019-01-08 20:04:23 +00:00
|
|
|
canvas->drawString("A", 50, 50, SkFont(), SkPaint());
|
2016-05-02 20:22:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
DEF_TEST(skbug5221, r) {
|
|
|
|
sk_sp<SkSurface> surface(SkSurface::MakeRaster(SkImageInfo::MakeN32Premul(256, 256)));
|
|
|
|
test(surface->getCanvas());
|
|
|
|
}
|
|
|
|
|
|
|
|
DEF_GPUTEST_FOR_ALL_CONTEXTS(skbug5221_GPU, r, contextInfo) {
|
2017-06-23 16:04:22 +00:00
|
|
|
sk_sp<SkSurface> surface(SkSurface::MakeRenderTarget(
|
2020-07-06 14:56:46 +00:00
|
|
|
contextInfo.directContext(), SkBudgeted::kYes,
|
2017-06-23 16:04:22 +00:00
|
|
|
SkImageInfo::Make(256, 256, kRGBA_8888_SkColorType, kPremul_SkAlphaType)));
|
2016-05-02 20:22:13 +00:00
|
|
|
test(surface->getCanvas());
|
|
|
|
}
|