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

Unified Diff: bench/subset/SubsetZoomBench.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/subset/SubsetTranslateBench.cpp ('k') | dm/DM.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/subset/SubsetZoomBench.cpp
diff --git a/bench/subset/SubsetZoomBench.cpp b/bench/subset/SubsetZoomBench.cpp
index 655285fdf812446205c3953a2658a8299c0df52c..869e93043d6c21684c3e0600992c0a6572a6b795 100644
--- a/bench/subset/SubsetZoomBench.cpp
+++ b/bench/subset/SubsetZoomBench.cpp
@@ -12,7 +12,6 @@
#include "SkCodec.h"
#include "SkImageDecoder.h"
#include "SkOSFile.h"
-#include "SkScanlineDecoder.h"
#include "SkStream.h"
/*
@@ -61,11 +60,10 @@ void SubsetZoomBench::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);
const int centerX = info.width() / 2;
const int centerY = info.height() / 2;
@@ -83,9 +81,9 @@ void SubsetZoomBench::onDraw(const int n, SkCanvas* canvas) {
alloc_pixels(&bitmap, subsetInfo, colors, colorCount);
uint32_t bpp = info.bytesPerPixel();
- scanlineDecoder->skipScanlines(subsetStartY);
+ codec->skipScanlines(subsetStartY);
for (int y = 0; y < subsetHeight; y++) {
- scanlineDecoder->getScanlines(row.get(), 1, 0);
+ codec->getScanlines(row.get(), 1, 0);
memcpy(bitmap.getAddr(0, y), row.get() + subsetStartX * bpp,
subsetWidth * bpp);
}
« no previous file with comments | « bench/subset/SubsetTranslateBench.cpp ('k') | dm/DM.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698