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

Side by Side Diff: tools/SkBitmapRegionSampler.cpp

Issue 1406033007: Delete dead BitmapRegionDecoder code in tools (Closed) Base URL: https://skia.googlesource.com/skia.git@delete-dm
Patch Set: Created 5 years, 1 month 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 unified diff | Download patch
« dm/DM.cpp ('K') | « tools/SkBitmapRegionSampler.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #include "SkBitmapRegionSampler.h"
9 #include "SkCodecPriv.h"
10
11 SkBitmapRegionSampler::SkBitmapRegionSampler(SkImageDecoder* decoder, int width,
12 int height)
13 : INHERITED(width, height)
14 , fDecoder(decoder)
15 {}
16
17 bool SkBitmapRegionSampler::decodeRegion(SkBitmap* bitmap, SkBitmap::Allocator* allocator,
18 const SkIRect& desiredSubset, int sampleSize, SkColorType colorType, boo l requireUnpremul) {
19 fDecoder->setDitherImage(true);
20 fDecoder->setPreferQualityOverSpeed(false);
21 fDecoder->setRequireUnpremultipliedColors(false);
22 fDecoder->setSampleSize(sampleSize);
23 fDecoder->setAllocator(allocator);
24
25 // kAlpha8 is the legacy representation of kGray8 used by SkImageDecoder
26 if (kGray_8_SkColorType == colorType) {
27 colorType = kAlpha_8_SkColorType;
28 }
29
30 bool result = fDecoder->decodeSubset(bitmap, desiredSubset, colorType);
31 fDecoder->setAllocator(nullptr);
32 return result;
33 }
OLDNEW
« dm/DM.cpp ('K') | « tools/SkBitmapRegionSampler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698