fix leaked picture

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1329143006
This commit is contained in:
reed 2015-09-09 13:42:14 -07:00 committed by Commit bot
parent 9583ab9d7a
commit 25507d9a94

View File

@ -32,7 +32,8 @@ static SkImage* make_raster_image(int width, int height, SkColor colors[2]) {
static SkImage* make_picture_image(int width, int height, SkColor colors[2]) {
SkPictureRecorder recorder;
draw(recorder.beginRecording(SkRect::MakeIWH(width, height)), width, height, colors);
return SkImage::NewFromPicture(recorder.endRecording(), SkISize::Make(width, height),
SkAutoTUnref<SkPicture> picture(recorder.endRecording());
return SkImage::NewFromPicture(picture, SkISize::Make(width, height),
nullptr, nullptr);
}