| Index: bench/subset/SubsetTranslateBench.cpp
|
| diff --git a/bench/subset/SubsetTranslateBench.cpp b/bench/subset/SubsetTranslateBench.cpp
|
| index 8f6f2ea21b5d8665aa6ca53209e634920e5cdba4..a2536d2b2b24e18e6398c058e4506b264aaa4e64 100644
|
| --- a/bench/subset/SubsetTranslateBench.cpp
|
| +++ b/bench/subset/SubsetTranslateBench.cpp
|
| @@ -11,7 +11,6 @@
|
| #include "SkCodec.h"
|
| #include "SkImageDecoder.h"
|
| #include "SkOSFile.h"
|
| -#include "SkScanlineDecoder.h"
|
| #include "SkStream.h"
|
|
|
| /*
|
| @@ -60,11 +59,10 @@ void SubsetTranslateBench::onDraw(const int n, SkCanvas* canvas) {
|
| SkPMColor colors[256];
|
| if (fUseCodec) {
|
| for (int count = 0; count < n; count++) {
|
| - SkAutoTDelete<SkScanlineDecoder> scanlineDecoder(
|
| - SkScanlineDecoder::NewFromStream(fStream->duplicate()));
|
| - const SkImageInfo info = scanlineDecoder->getInfo().makeColorType(fColorType);
|
| + SkAutoTDelete<SkCodec> codec(SkCodec::NewFromStream(fStream->duplicate()));
|
| + const SkImageInfo info = codec->getInfo().makeColorType(fColorType);
|
| SkAutoTDeleteArray<uint8_t> row(new uint8_t[info.minRowBytes()]);
|
| - scanlineDecoder->start(info, nullptr, colors, &colorCount);
|
| + codec->start(info, nullptr, colors, &colorCount);
|
|
|
| SkBitmap bitmap;
|
| // Note that we use the same bitmap for all of the subsets.
|
| @@ -74,7 +72,7 @@ void SubsetTranslateBench::onDraw(const int n, SkCanvas* canvas) {
|
|
|
| for (int x = 0; x < info.width(); x += fSubsetWidth) {
|
| for (int y = 0; y < info.height(); y += fSubsetHeight) {
|
| - scanlineDecoder->skipScanlines(y);
|
| + codec->skipScanlines(y);
|
| const uint32_t currSubsetWidth =
|
| x + (int) fSubsetWidth > info.width() ?
|
| info.width() - x : fSubsetWidth;
|
| @@ -83,7 +81,7 @@ void SubsetTranslateBench::onDraw(const int n, SkCanvas* canvas) {
|
| info.height() - y : fSubsetHeight;
|
| const uint32_t bpp = info.bytesPerPixel();
|
| for (uint32_t y = 0; y < currSubsetHeight; y++) {
|
| - scanlineDecoder->getScanlines(row.get(), 1, 0);
|
| + codec->getScanlines(row.get(), 1, 0);
|
| memcpy(bitmap.getAddr(0, y), row.get() + x * bpp,
|
| currSubsetWidth * bpp);
|
| }
|
|
|