diff options
author | reed <reed@google.com> | 2016-09-12 12:01:44 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-09-12 12:01:44 -0700 |
commit | 42943c8aa9c611c18ad0f1a30a27669f3d82239c (patch) | |
tree | deff0bbc59dd92559191c188d73f97b4f9c580aa /bench | |
parent | 09524ae42998ece3a8e7973064ab286646511b31 (diff) |
change SkStreams to work with sk_sp<SkData> instead of SkData*
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2333713002
Review-Url: https://codereview.chromium.org/2333713002
Diffstat (limited to 'bench')
-rw-r--r-- | bench/AndroidCodecBench.cpp | 4 | ||||
-rw-r--r-- | bench/BitmapRegionDecoderBench.cpp | 3 | ||||
-rw-r--r-- | bench/CodecBench.cpp | 6 | ||||
-rw-r--r-- | bench/ColorCodecBench.cpp | 6 | ||||
-rw-r--r-- | bench/nanobench.cpp | 8 |
5 files changed, 13 insertions, 14 deletions
diff --git a/bench/AndroidCodecBench.cpp b/bench/AndroidCodecBench.cpp index 6443ce69b7..97e1176044 100644 --- a/bench/AndroidCodecBench.cpp +++ b/bench/AndroidCodecBench.cpp @@ -29,7 +29,7 @@ bool AndroidCodecBench::isSuitableFor(Backend backend) { } void AndroidCodecBench::onDelayedSetup() { - SkAutoTDelete<SkAndroidCodec> codec(SkAndroidCodec::NewFromData(fData.get())); + SkAutoTDelete<SkAndroidCodec> codec(SkAndroidCodec::NewFromData(fData)); SkISize scaledSize = codec->getSampledDimensions(fSampleSize); fInfo = codec->getInfo().makeWH(scaledSize.width(), scaledSize.height()) @@ -46,7 +46,7 @@ void AndroidCodecBench::onDraw(int n, SkCanvas* canvas) { SkAndroidCodec::AndroidOptions options; options.fSampleSize = fSampleSize; for (int i = 0; i < n; i++) { - codec.reset(SkAndroidCodec::NewFromData(fData.get())); + codec.reset(SkAndroidCodec::NewFromData(fData)); #ifdef SK_DEBUG const SkCodec::Result result = #endif diff --git a/bench/BitmapRegionDecoderBench.cpp b/bench/BitmapRegionDecoderBench.cpp index 709ad0e89d..dd60b18296 100644 --- a/bench/BitmapRegionDecoderBench.cpp +++ b/bench/BitmapRegionDecoderBench.cpp @@ -36,8 +36,7 @@ bool BitmapRegionDecoderBench::isSuitableFor(Backend backend) { } void BitmapRegionDecoderBench::onDelayedSetup() { - fBRD.reset(SkBitmapRegionDecoder::Create(fData.get(), - SkBitmapRegionDecoder::kAndroidCodec_Strategy)); + fBRD.reset(SkBitmapRegionDecoder::Create(fData, SkBitmapRegionDecoder::kAndroidCodec_Strategy)); } void BitmapRegionDecoderBench::onDraw(int n, SkCanvas* canvas) { diff --git a/bench/CodecBench.cpp b/bench/CodecBench.cpp index e3bf1ccb22..9bd404db55 100644 --- a/bench/CodecBench.cpp +++ b/bench/CodecBench.cpp @@ -26,7 +26,7 @@ CodecBench::CodecBench(SkString baseName, SkData* encoded, SkColorType colorType alpha_type_to_str(alphaType)); #ifdef SK_DEBUG // Ensure that we can create an SkCodec from this data. - SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(fData.get())); + SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(fData)); SkASSERT(codec); #endif } @@ -40,7 +40,7 @@ bool CodecBench::isSuitableFor(Backend backend) { } void CodecBench::onDelayedSetup() { - SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(fData.get())); + SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(fData)); fInfo = codec->getInfo().makeColorType(fColorType) .makeAlphaType(fAlphaType) @@ -59,7 +59,7 @@ void CodecBench::onDraw(int n, SkCanvas* canvas) { } for (int i = 0; i < n; i++) { colorCount = 256; - codec.reset(SkCodec::NewFromData(fData.get())); + codec.reset(SkCodec::NewFromData(fData)); #ifdef SK_DEBUG const SkCodec::Result result = #endif diff --git a/bench/ColorCodecBench.cpp b/bench/ColorCodecBench.cpp index 9f57ddc623..9aa5d73978 100644 --- a/bench/ColorCodecBench.cpp +++ b/bench/ColorCodecBench.cpp @@ -40,7 +40,7 @@ bool ColorCodecBench::isSuitableFor(Backend backend) { } void ColorCodecBench::decodeAndXform() { - SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(fEncoded.get())); + SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(fEncoded)); SkASSERT(codec); #ifdef SK_DEBUG @@ -52,7 +52,7 @@ void ColorCodecBench::decodeAndXform() { #if defined(SK_TEST_QCMS) void ColorCodecBench::decodeAndXformQCMS() { - SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(fEncoded.get())); + SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(fEncoded)); #ifdef SK_DEBUG const SkCodec::Result result = #endif @@ -135,7 +135,7 @@ void ColorCodecBench::xformOnlyQCMS() { #endif void ColorCodecBench::onDelayedSetup() { - SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(fEncoded.get())); + SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(fEncoded)); fSrcData = codec->getICCData(); sk_sp<SkData> dstData = SkData::MakeFromFileName( GetResourcePath("icc_profiles/HP_ZR30w.icc").c_str()); diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp index a2f931e98b..ae415fa06b 100644 --- a/bench/nanobench.cpp +++ b/bench/nanobench.cpp @@ -529,7 +529,7 @@ static Target* is_enabled(Benchmark* bench, const Config& config) { return target; } -static bool valid_brd_bench(SkData* encoded, SkColorType colorType, uint32_t sampleSize, +static bool valid_brd_bench(sk_sp<SkData> encoded, SkColorType colorType, uint32_t sampleSize, uint32_t minOutputSize, int* width, int* height) { SkAutoTDelete<SkBitmapRegionDecoder> brd( SkBitmapRegionDecoder::Create(encoded, SkBitmapRegionDecoder::kAndroidCodec_Strategy)); @@ -756,7 +756,7 @@ public: continue; } sk_sp<SkData> encoded(SkData::MakeFromFileName(path.c_str())); - SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded.get())); + SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded)); if (!codec) { // Nothing to time. SkDebugf("Cannot find codec for %s\n", path.c_str()); @@ -840,7 +840,7 @@ public: continue; } sk_sp<SkData> encoded(SkData::MakeFromFileName(path.c_str())); - SkAutoTDelete<SkAndroidCodec> codec(SkAndroidCodec::NewFromData(encoded.get())); + SkAutoTDelete<SkAndroidCodec> codec(SkAndroidCodec::NewFromData(encoded)); if (!codec) { // Nothing to time. SkDebugf("Cannot find codec for %s\n", path.c_str()); @@ -896,7 +896,7 @@ public: int width = 0; int height = 0; - if (!valid_brd_bench(encoded.get(), colorType, sampleSize, minOutputSize, + if (!valid_brd_bench(encoded, colorType, sampleSize, minOutputSize, &width, &height)) { break; } |