diff options
author | bsalomon <bsalomon@google.com> | 2014-08-21 14:40:36 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-08-21 14:40:37 -0700 |
commit | 892f31ab08b2220c591f0906e41eb766db4afb47 (patch) | |
tree | d75123c9946eac156c34b590f37cdff825c30de9 /gm | |
parent | d92c4c5c95403fe771c4f4342bd6527be455cc81 (diff) |
Fix surface leak in multidraw GMs.
TBR=robertphillips@google.com
Author: bsalomon@google.com
Review URL: https://codereview.chromium.org/496793003
Diffstat (limited to 'gm')
-rw-r--r-- | gm/multipicturedraw.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gm/multipicturedraw.cpp b/gm/multipicturedraw.cpp index 8e74c2821c..a030bccdbf 100644 --- a/gm/multipicturedraw.cpp +++ b/gm/multipicturedraw.cpp @@ -75,7 +75,7 @@ static const SkPicture* make_picture(SkColor fillColor) { return recorder.endRecording(); } -static SkSurface* compat_surface(SkCanvas* canvas, int width, int height) { +static SkSurface* create_compat_surface(SkCanvas* canvas, int width, int height) { SkImageInfo info = SkImageInfo::MakeN32Premul(width, height); SkSurface* surface = canvas->newSurface(info); @@ -197,7 +197,7 @@ static void simple(SkCanvas* finalCanvas, SkMultiPictureDraw* mpd, ComposeStep& step = composeSteps->push_back(); - step.fSurf = SkSafeRef(compat_surface(finalCanvas, kPicWidth, kPicHeight)); + step.fSurf = create_compat_surface(finalCanvas, kPicWidth, kPicHeight); SkCanvas* subCanvas = step.fSurf->getCanvas(); @@ -232,7 +232,7 @@ static void tiled(SkCanvas* finalCanvas, SkMultiPictureDraw* mpd, step.fPaint->setColorFilter( SkColorFilter::CreateModeFilter(colors[x][y], SkXfermode::kModulate_Mode))->unref(); - step.fSurf = SkSafeRef(compat_surface(finalCanvas, kTileWidth, kTileHeight)); + step.fSurf = create_compat_surface(finalCanvas, kTileWidth, kTileHeight); SkCanvas* subCanvas = step.fSurf->getCanvas(); |