diff options
author | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-04 03:56:21 +0000 |
---|---|---|
committer | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-04 03:56:21 +0000 |
commit | a1f24b7661fb256f34dc36d9254764ba6e12578c (patch) | |
tree | 5d7b7f565f086e37674f66c78f916d5a38170876 /printing/metafile_skia_wrapper.cc | |
parent | 85167c7673eec9a00a7d4daab61620c802567191 (diff) | |
download | chromium_src-a1f24b7661fb256f34dc36d9254764ba6e12578c.zip chromium_src-a1f24b7661fb256f34dc36d9254764ba6e12578c.tar.gz chromium_src-a1f24b7661fb256f34dc36d9254764ba6e12578c.tar.bz2 |
printing: Use skia::RefPtr to replace manual ref-counting.
R=vandebo@chromium.org
BUG=163454
Depends on: https://codereview.chromium.org/11428099/
NOTRY=true
Review URL: https://chromiumcodereview.appspot.com/11316263
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170878 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'printing/metafile_skia_wrapper.cc')
-rw-r--r-- | printing/metafile_skia_wrapper.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/printing/metafile_skia_wrapper.cc b/printing/metafile_skia_wrapper.cc index d4634ef..2fddc00 100644 --- a/printing/metafile_skia_wrapper.cc +++ b/printing/metafile_skia_wrapper.cc @@ -4,6 +4,7 @@ #include "printing/metafile_skia_wrapper.h" #include "skia/ext/platform_device.h" +#include "skia/ext/refptr.h" #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkDevice.h" #include "third_party/skia/include/core/SkMetaData.h" @@ -20,13 +21,12 @@ const char* kCustomScaleKey = "CrCustomScale"; // static void MetafileSkiaWrapper::SetMetafileOnCanvas(const SkCanvas& canvas, Metafile* metafile) { - MetafileSkiaWrapper* wrapper = NULL; + skia::RefPtr<MetafileSkiaWrapper> wrapper; if (metafile) - wrapper = new MetafileSkiaWrapper(metafile); + wrapper = skia::AdoptRef(new MetafileSkiaWrapper(metafile)); SkMetaData& meta = skia::getMetaData(canvas); - meta.setRefCnt(kMetafileKey, wrapper); - SkSafeUnref(wrapper); + meta.setRefCnt(kMetafileKey, wrapper.get()); } // static |