diff options
author | 2013-01-04 17:59:42 +0000 | |
---|---|---|
committer | 2013-01-04 17:59:42 +0000 | |
commit | e8a76ae8edc4f90456f9d8f90e56bf97f2657f3a (patch) | |
tree | 4e7d18468236dd4af78d207d719a9c265e86facd /src/pdf/SkPDFImage.cpp | |
parent | 2fb96cc5d713451216bd63d5dc8d19abc8550730 (diff) |
Remove SkRefPtr
Review URL: https://codereview.appspot.com/7030059
git-svn-id: http://skia.googlecode.com/svn/trunk@7021 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/pdf/SkPDFImage.cpp')
-rw-r--r-- | src/pdf/SkPDFImage.cpp | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/pdf/SkPDFImage.cpp b/src/pdf/SkPDFImage.cpp index 429667a5e2..1b93f6e045 100644 --- a/src/pdf/SkPDFImage.cpp +++ b/src/pdf/SkPDFImage.cpp @@ -305,8 +305,7 @@ SkPDFImage::SkPDFImage(SkStream* imageData, const SkBitmap& bitmap, if (!doingAlpha && alphaOnly) { // For alpha only images, we stretch a single pixel of black for // the color/shape part. - SkRefPtr<SkPDFInt> one = new SkPDFInt(1); - one->unref(); // SkRefPtr and new both took a reference. + SkAutoTUnref<SkPDFInt> one(new SkPDFInt(1)); insert("Width", one.get()); insert("Height", one.get()); } else { @@ -335,16 +334,12 @@ SkPDFImage::SkPDFImage(SkStream* imageData, const SkBitmap& bitmap, insertInt("BitsPerComponent", bitsPerComp); if (config == SkBitmap::kRGB_565_Config) { - SkRefPtr<SkPDFInt> zeroVal = new SkPDFInt(0); - zeroVal->unref(); // SkRefPtr and new both took a reference. - SkRefPtr<SkPDFScalar> scale5Val = - new SkPDFScalar(SkFloatToScalar(8.2258f)); // 255/2^5-1 - scale5Val->unref(); // SkRefPtr and new both took a reference. - SkRefPtr<SkPDFScalar> scale6Val = - new SkPDFScalar(SkFloatToScalar(4.0476f)); // 255/2^6-1 - scale6Val->unref(); // SkRefPtr and new both took a reference. - SkRefPtr<SkPDFArray> decodeValue = new SkPDFArray(); - decodeValue->unref(); // SkRefPtr and new both took a reference. + SkAutoTUnref<SkPDFInt> zeroVal(new SkPDFInt(0)); + SkAutoTUnref<SkPDFScalar> scale5Val( + new SkPDFScalar(SkFloatToScalar(8.2258f))); // 255/2^5-1 + SkAutoTUnref<SkPDFScalar> scale6Val( + new SkPDFScalar(SkFloatToScalar(4.0476f))); // 255/2^6-1 + SkAutoTUnref<SkPDFArray> decodeValue(new SkPDFArray()); decodeValue->reserve(6); decodeValue->append(zeroVal.get()); decodeValue->append(scale5Val.get()); |