OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * Copyright 2016 Google Inc. | |
3 * | |
4 * Use of this source code is governed by a BSD-style license that can be | |
5 * found in the LICENSE file. | |
6 */ | |
7 | |
8 #include "Test.h" | |
9 #include "SkCanvas.h" | |
10 #include "SkPath.h" | |
11 #include "SkSurface.h" | |
12 | |
13 // This passes by not crashing. | |
14 static void test(SkCanvas* canvas) { | |
15 SkPath path; | |
robertphillips
2016/05/02 19:15:22
Shouldn't we be jamming two rects into this path ?
bsalomon
2016/05/02 19:45:28
Oops.. meant to delete the path and just draw the
| |
16 SkPaint paint; | |
17 paint.setAntiAlias(true); | |
18 canvas->scale(63, 0); | |
19 canvas->drawPath(path, paint); | |
20 static const char kTxt[] = "A"; | |
21 canvas->drawText(kTxt, SK_ARRAY_COUNT(kTxt), 50, 50, paint); | |
22 } | |
23 | |
24 DEF_TEST(skbug5221, r) { | |
25 sk_sp<SkSurface> surface(SkSurface::MakeRaster(SkImageInfo::MakeN32Premul(25 6, 256))); | |
26 test(surface->getCanvas()); | |
27 } | |
28 | |
29 #if SK_SUPPORT_GPU | |
30 DEF_GPUTEST_FOR_ALL_CONTEXTS(skbug5221_GPU, r, contextInfo) { | |
31 sk_sp<SkSurface> surface(SkSurface::MakeRenderTarget(contextInfo.fGrContext, SkBudgeted::kYes, | |
32 SkImageInfo::MakeN32Pre mul(256, 256), 0, | |
33 nullptr)); | |
34 test(surface->getCanvas()); | |
35 } | |
36 #endif | |
OLD | NEW |