Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4074)

Unified Diff: bench/subset/SubsetSingleBench.cpp

Issue 1365313002: Merge SkCodec with SkScanlineDecoder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Skip ICO in SkScaledCodec for now Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « bench/nanobench.cpp ('k') | bench/subset/SubsetTranslateBench.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/subset/SubsetSingleBench.cpp
diff --git a/bench/subset/SubsetSingleBench.cpp b/bench/subset/SubsetSingleBench.cpp
index 2e5703f508c340e0cdb54297695aaa464dc46b2e..e409cf7ed88dd8e5116357713e24694f6b5e094a 100644
--- a/bench/subset/SubsetSingleBench.cpp
+++ b/bench/subset/SubsetSingleBench.cpp
@@ -12,7 +12,6 @@
#include "SkCodec.h"
#include "SkImageDecoder.h"
#include "SkOSFile.h"
-#include "SkScanlineDecoder.h"
#include "SkStream.h"
/*
@@ -65,20 +64,19 @@ void SubsetSingleBench::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->startScanlineDecode(info, nullptr, colors, &colorCount);
SkBitmap bitmap;
SkImageInfo subsetInfo = info.makeWH(fSubsetWidth, fSubsetHeight);
alloc_pixels(&bitmap, subsetInfo, colors, colorCount);
- scanlineDecoder->skipScanlines(fOffsetTop);
+ codec->skipScanlines(fOffsetTop);
uint32_t bpp = info.bytesPerPixel();
for (uint32_t y = 0; y < fSubsetHeight; y++) {
- scanlineDecoder->getScanlines(row.get(), 1, 0);
+ codec->getScanlines(row.get(), 1, 0);
memcpy(bitmap.getAddr(0, y), row.get() + fOffsetLeft * bpp,
fSubsetWidth * bpp);
}
« no previous file with comments | « bench/nanobench.cpp ('k') | bench/subset/SubsetTranslateBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698