diff options
Diffstat (limited to 'gm/stroketext.cpp')
-rw-r--r-- | gm/stroketext.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gm/stroketext.cpp b/gm/stroketext.cpp index 1791fea528..b9d56f10e4 100644 --- a/gm/stroketext.cpp +++ b/gm/stroketext.cpp @@ -8,6 +8,21 @@ #include "gm.h" #include "SkCanvas.h" +static void test_nulldev(SkCanvas* canvas) { + SkBitmap bm; + bm.setConfig(SkBitmap::kARGB_8888_Config, 30, 30); + // notice: no pixels mom! be sure we don't crash + // https://code.google.com/p/chromium/issues/detail?id=352616 + SkCanvas c(bm); + + SkBitmap src; + src.allocN32Pixels(10, 10); + src.eraseColor(SK_ColorRED); + + // ensure we don't crash + c.writePixels(src, 0, 0); +} + static void draw_text_stroked(SkCanvas* canvas, const SkPaint& paint) { SkPaint p(paint); SkPoint loc = { 20, 450 }; @@ -44,6 +59,7 @@ protected: } virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { + if (true) { test_nulldev(canvas); } SkPaint paint; paint.setAntiAlias(true); |