OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "gm.h" | 8 #include "gm.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkDashPathEffect.h" | 10 #include "SkDashPathEffect.h" |
11 | 11 |
12 static void test_nulldev(SkCanvas* canvas) { | 12 static void test_nulldev(SkCanvas* canvas) { |
13 SkBitmap bm; | 13 SkBitmap bm; |
14 bm.setConfig(SkBitmap::kARGB_8888_Config, 30, 30); | 14 bm.setInfo(SkImageInfo::MakeN32Premul(30, 30)); |
15 // notice: no pixels mom! be sure we don't crash | 15 // notice: no pixels mom! be sure we don't crash |
16 // https://code.google.com/p/chromium/issues/detail?id=352616 | 16 // https://code.google.com/p/chromium/issues/detail?id=352616 |
17 SkCanvas c(bm); | 17 SkCanvas c(bm); |
18 | 18 |
19 SkBitmap src; | 19 SkBitmap src; |
20 src.allocN32Pixels(10, 10); | 20 src.allocN32Pixels(10, 10); |
21 src.eraseColor(SK_ColorRED); | 21 src.eraseColor(SK_ColorRED); |
22 | 22 |
23 // ensure we don't crash | 23 // ensure we don't crash |
24 c.writePixels(src, 0, 0); | 24 c.writePixels(src, 0, 0); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 canvas->translate(600, 0); | 94 canvas->translate(600, 0); |
95 paint.setTextSize(kAboveThreshold_TextSize); | 95 paint.setTextSize(kAboveThreshold_TextSize); |
96 draw_text_set(canvas, paint); | 96 draw_text_set(canvas, paint); |
97 } | 97 } |
98 | 98 |
99 private: | 99 private: |
100 typedef skiagm::GM INHERITED; | 100 typedef skiagm::GM INHERITED; |
101 }; | 101 }; |
102 | 102 |
103 DEF_GM( return SkNEW(StrokeTextGM); ) | 103 DEF_GM( return SkNEW(StrokeTextGM); ) |
OLD | NEW |