aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pdf/SkPDFImage.cpp
diff options
context:
space:
mode:
authorGravatar vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-01-04 18:11:21 +0000
committerGravatar vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-01-04 18:11:21 +0000
commit6eb549e8ca3d88d7536859fd5aa3343fc3011f2f (patch)
treed97411a5a61648e62f2e23e6139982681b9fa6d1 /src/pdf/SkPDFImage.cpp
parente8a76ae8edc4f90456f9d8f90e56bf97f2657f3a (diff)
Revert "Remove SkRefPtr" - r7021
samplecode/ still needs to be updated. Review URL: https://codereview.appspot.com/7032048 git-svn-id: http://skia.googlecode.com/svn/trunk@7022 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/pdf/SkPDFImage.cpp')
-rw-r--r--src/pdf/SkPDFImage.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/pdf/SkPDFImage.cpp b/src/pdf/SkPDFImage.cpp
index 1b93f6e045..429667a5e2 100644
--- a/src/pdf/SkPDFImage.cpp
+++ b/src/pdf/SkPDFImage.cpp
@@ -305,7 +305,8 @@ 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.
- SkAutoTUnref<SkPDFInt> one(new SkPDFInt(1));
+ SkRefPtr<SkPDFInt> one = new SkPDFInt(1);
+ one->unref(); // SkRefPtr and new both took a reference.
insert("Width", one.get());
insert("Height", one.get());
} else {
@@ -334,12 +335,16 @@ SkPDFImage::SkPDFImage(SkStream* imageData, const SkBitmap& bitmap,
insertInt("BitsPerComponent", bitsPerComp);
if (config == SkBitmap::kRGB_565_Config) {
- 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());
+ 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.
decodeValue->reserve(6);
decodeValue->append(zeroVal.get());
decodeValue->append(scale5Val.get());