diff options
Diffstat (limited to 'gm/ninepatchstretch.cpp')
-rw-r--r-- | gm/ninepatchstretch.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gm/ninepatchstretch.cpp b/gm/ninepatchstretch.cpp index 74cc87f305..a14af00a4e 100644 --- a/gm/ninepatchstretch.cpp +++ b/gm/ninepatchstretch.cpp @@ -13,7 +13,10 @@ static void make_bitmap(SkBitmap* bitmap, SkIRect* center) { const int kSize = 2*kFixed + kStretchy; bitmap->allocN32Pixels(kSize, kSize); - SkCanvas canvas(*bitmap); + SkBaseDevice* dev = new SkBitmapDevice(*bitmap); + + SkCanvas canvas(dev); + dev->unref(); canvas.clear(SK_ColorTRANSPARENT); SkRect r = SkRect::MakeWH(SkIntToScalar(kSize), SkIntToScalar(kSize)); |