aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/codec
diff options
context:
space:
mode:
authorGravatar Hal Canary <halcanary@google.com>2016-11-07 11:47:44 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-11-07 17:22:19 +0000
commit67b39de70fb5d10caebfc75f418754186e5226c3 (patch)
tree53a773248fb4dbc02bdf71c89e9619398c5f2f95 /src/codec
parent09c85a53c370325d4e8646e34be7684728a1f375 (diff)
s/SkAutoTUnref/sk_sp/ in src/ part 1
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4480 Change-Id: I7d3219b02ad5094785e1b7635a9482e69aadbc8c Reviewed-on: https://skia-review.googlesource.com/4480 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
Diffstat (limited to 'src/codec')
-rw-r--r--src/codec/SkBmpRLECodec.cpp2
-rw-r--r--src/codec/SkBmpRLECodec.h22
-rw-r--r--src/codec/SkBmpStandardCodec.cpp2
-rw-r--r--src/codec/SkBmpStandardCodec.h20
-rw-r--r--src/codec/SkPngCodec.cpp2
-rw-r--r--src/codec/SkPngCodec.h16
-rw-r--r--src/codec/SkWbmpCodec.h8
7 files changed, 36 insertions, 36 deletions
diff --git a/src/codec/SkBmpRLECodec.cpp b/src/codec/SkBmpRLECodec.cpp
index b8013093fb..0bc6f60542 100644
--- a/src/codec/SkBmpRLECodec.cpp
+++ b/src/codec/SkBmpRLECodec.cpp
@@ -291,7 +291,7 @@ SkCodec::Result SkBmpRLECodec::onPrepareToDecode(const SkImageInfo& dstInfo,
}
// Copy the color table to the client if necessary
- copy_color_table(dstInfo, this->fColorTable, inputColorPtr, inputColorCount);
+ copy_color_table(dstInfo, fColorTable.get(), inputColorPtr, inputColorCount);
// Initialize a buffer for encoded RLE data
fRLEBytes = fOrigRLEBytes;
diff --git a/src/codec/SkBmpRLECodec.h b/src/codec/SkBmpRLECodec.h
index 5f348618a9..7cb3e9b292 100644
--- a/src/codec/SkBmpRLECodec.h
+++ b/src/codec/SkBmpRLECodec.h
@@ -95,23 +95,23 @@ private:
SkSampler* getSampler(bool createIfNecessary) override;
- SkAutoTUnref<SkColorTable> fColorTable; // owned
+ sk_sp<SkColorTable> fColorTable;
// fNumColors is the number specified in the header, or 0 if not present in the header.
- const uint32_t fNumColors;
- const uint32_t fBytesPerColor;
- const uint32_t fOffset;
- std::unique_ptr<uint8_t[]> fStreamBuffer;
- size_t fRLEBytes;
- const size_t fOrigRLEBytes;
- uint32_t fCurrRLEByte;
- int fSampleX;
- std::unique_ptr<SkSampler> fSampler;
+ const uint32_t fNumColors;
+ const uint32_t fBytesPerColor;
+ const uint32_t fOffset;
+ std::unique_ptr<uint8_t[]> fStreamBuffer;
+ size_t fRLEBytes;
+ const size_t fOrigRLEBytes;
+ uint32_t fCurrRLEByte;
+ int fSampleX;
+ std::unique_ptr<SkSampler> fSampler;
// Scanline decodes allow the client to ask for a single scanline at a time.
// This can be tricky when the RLE encoding instructs the decoder to jump down
// multiple lines. This field keeps track of lines that need to be skipped
// on subsequent calls to decodeRows().
- int fLinesToSkip;
+ int fLinesToSkip;
typedef SkBmpCodec INHERITED;
};
diff --git a/src/codec/SkBmpStandardCodec.cpp b/src/codec/SkBmpStandardCodec.cpp
index 9b346f3be6..004c2571d5 100644
--- a/src/codec/SkBmpStandardCodec.cpp
+++ b/src/codec/SkBmpStandardCodec.cpp
@@ -215,7 +215,7 @@ SkCodec::Result SkBmpStandardCodec::onPrepareToDecode(const SkImageInfo& dstInfo
}
// Copy the color table to the client if necessary
- copy_color_table(dstInfo, this->fColorTable, inputColorPtr, inputColorCount);
+ copy_color_table(dstInfo, fColorTable.get(), inputColorPtr, inputColorCount);
// Initialize a swizzler
this->initializeSwizzler(dstInfo, options);
diff --git a/src/codec/SkBmpStandardCodec.h b/src/codec/SkBmpStandardCodec.h
index 12c12e8893..61b2792404 100644
--- a/src/codec/SkBmpStandardCodec.h
+++ b/src/codec/SkBmpStandardCodec.h
@@ -84,17 +84,17 @@ private:
*/
void decodeIcoMask(SkStream* stream, const SkImageInfo& dstInfo, void* dst, size_t dstRowBytes);
- SkAutoTUnref<SkColorTable> fColorTable; // owned
+ sk_sp<SkColorTable> fColorTable;
// fNumColors is the number specified in the header, or 0 if not present in the header.
- const uint32_t fNumColors;
- const uint32_t fBytesPerColor;
- const uint32_t fOffset;
- std::unique_ptr<SkSwizzler> fSwizzler;
- std::unique_ptr<uint8_t[]> fSrcBuffer;
- const bool fIsOpaque;
- const bool fInIco;
- const size_t fAndMaskRowBytes; // only used for fInIco decodes
- bool fXformOnDecode;
+ const uint32_t fNumColors;
+ const uint32_t fBytesPerColor;
+ const uint32_t fOffset;
+ std::unique_ptr<SkSwizzler> fSwizzler;
+ std::unique_ptr<uint8_t[]> fSrcBuffer;
+ const bool fIsOpaque;
+ const bool fInIco;
+ const size_t fAndMaskRowBytes; // only used for fInIco decodes
+ bool fXformOnDecode;
typedef SkBmpCodec INHERITED;
};
diff --git a/src/codec/SkPngCodec.cpp b/src/codec/SkPngCodec.cpp
index 8297dd49be..3cf972dc76 100644
--- a/src/codec/SkPngCodec.cpp
+++ b/src/codec/SkPngCodec.cpp
@@ -1084,7 +1084,7 @@ bool SkPngCodec::initializeXforms(const SkImageInfo& dstInfo, const Options& opt
}
// Copy the color table to the client if they request kIndex8 mode.
- copy_color_table(dstInfo, fColorTable, ctable, ctableCount);
+ copy_color_table(dstInfo, fColorTable.get(), ctable, ctableCount);
this->initializeSwizzler(dstInfo, options);
return true;
diff --git a/src/codec/SkPngCodec.h b/src/codec/SkPngCodec.h
index 2c427cac95..590a631a20 100644
--- a/src/codec/SkPngCodec.h
+++ b/src/codec/SkPngCodec.h
@@ -91,16 +91,16 @@ protected:
SkPMColor* ctable, int* ctableCount) override;
Result onIncrementalDecode(int*) override;
- SkAutoTUnref<SkPngChunkReader> fPngChunkReader;
- voidp fPng_ptr;
- voidp fInfo_ptr;
+ sk_sp<SkPngChunkReader> fPngChunkReader;
+ voidp fPng_ptr;
+ voidp fInfo_ptr;
// These are stored here so they can be used both by normal decoding and scanline decoding.
- SkAutoTUnref<SkColorTable> fColorTable; // May be unpremul.
- std::unique_ptr<SkSwizzler> fSwizzler;
- SkAutoTMalloc<uint8_t> fStorage;
- uint32_t* fColorXformSrcRow;
- const int fBitDepth;
+ sk_sp<SkColorTable> fColorTable; // May be unpremul.
+ std::unique_ptr<SkSwizzler> fSwizzler;
+ SkAutoTMalloc<uint8_t> fStorage;
+ uint32_t* fColorXformSrcRow;
+ const int fBitDepth;
private:
diff --git a/src/codec/SkWbmpCodec.h b/src/codec/SkWbmpCodec.h
index 3c8df02388..6946ea0a66 100644
--- a/src/codec/SkWbmpCodec.h
+++ b/src/codec/SkWbmpCodec.h
@@ -46,12 +46,12 @@ private:
SkWbmpCodec(int width, int height, const SkEncodedInfo&, SkStream*);
- const size_t fSrcRowBytes;
+ const size_t fSrcRowBytes;
// Used for scanline decodes:
- std::unique_ptr<SkSwizzler> fSwizzler;
- SkAutoTUnref<SkColorTable> fColorTable;
- SkAutoTMalloc<uint8_t> fSrcBuffer;
+ std::unique_ptr<SkSwizzler> fSwizzler;
+ sk_sp<SkColorTable> fColorTable;
+ SkAutoTMalloc<uint8_t> fSrcBuffer;
int onGetScanlines(void* dst, int count, size_t dstRowBytes) override;
bool onSkipScanlines(int count) override;