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

Side by Side Diff: src/utils/SkBitmapRegionSampler.h

Issue 1288963002: Provides multiple implementations of Android's SkBitmapRegionDecoder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Response to comments 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 unified diff | Download patch
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 "SkBitmap.h"
9 #include "SkBitmapRegionDecoder.h"
10 #include "SkImageDecoder.h"
11 #include "SkTemplates.h"
12
13 /*
14 * This class aims to duplicate the current implementation of
15 * SkBitmapRegionDecoder in Android.
16 */
17 class SkBitmapRegionSampler : public SkBitmapRegionDecoder {
18 public:
19
20 /*
21 * Takes ownership of pointer to decoder
22 */
23 SkBitmapRegionSampler(SkImageDecoder* decoder, int width, int height);
24
25 /*
26 * This has several key differences from the Android version:
scroggo 2015/09/02 21:32:25 "several" or three?
msarett 2015/09/03 19:20:52 Acknowledged.
27 * Returns a Skia bitmap instead of an Android bitmap.
28 * Android version attempts to reuse a recycled bitmap.
29 * Removed the options object and used parameters for color type and
30 * sample size.
31 */
32 SkBitmap* decodeRegion(int start_x, int start_y, int width, int height,
33 int sampleSize, SkColorType prefColorType) override;
34
35 private:
36
37 SkAutoTDelete<SkImageDecoder> fDecoder;
38
39 typedef SkBitmapRegionDecoder INHERITED;
40
41 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698