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

Side by Side Diff: tools/SkBitmapRegionCodec.h

Issue 1418093006: Refactor SkBitmapRegionDecoderInterface for Android (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Better comments 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
« no previous file with comments | « tools/SkBitmapRegionCanvas.cpp ('k') | tools/SkBitmapRegionCodec.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkBitmapRegionDecoderInterface.h" 9 #include "SkBitmapRegionDecoderInterface.h"
10 #include "SkAndroidCodec.h" 10 #include "SkAndroidCodec.h"
11 11
12 /* 12 /*
13 * This class implements SkBitmapRegionDecoder using an SkAndroidCodec. 13 * This class implements SkBitmapRegionDecoder using an SkAndroidCodec.
14 */ 14 */
15 class SkBitmapRegionCodec : public SkBitmapRegionDecoderInterface { 15 class SkBitmapRegionCodec : public SkBitmapRegionDecoderInterface {
16 public: 16 public:
17 17
18 /* 18 /*
19 * Takes ownership of pointer to codec 19 * Takes ownership of pointer to codec
20 */ 20 */
21 SkBitmapRegionCodec(SkAndroidCodec* codec); 21 SkBitmapRegionCodec(SkAndroidCodec* codec);
22 22
23 /* 23 bool decodeRegion(SkBitmap* bitmap, SkBitmap::Allocator* allocator,
24 * Three differences from the Android version: 24 const SkIRect& desiredSubset, int sampleSize,
25 * Returns a Skia bitmap instead of an Android bitmap. 25 SkColorType colorType, bool requireUnpremul) override;
26 * Android version attempts to reuse a recycled bitmap.
27 * Removed the options object and used parameters for color type and
28 * sample size.
29 */
30 SkBitmap* decodeRegion(int start_x, int start_y, int width, int height,
31 int sampleSize, SkColorType prefColorType) override;
32 26
33 bool conversionSupported(SkColorType colorType) override; 27 bool conversionSupported(SkColorType colorType) override;
34 28
35 private: 29 private:
36 30
37 SkAutoTDelete<SkAndroidCodec> fCodec; 31 SkAutoTDelete<SkAndroidCodec> fCodec;
38 32
39 typedef SkBitmapRegionDecoderInterface INHERITED; 33 typedef SkBitmapRegionDecoderInterface INHERITED;
40 34
41 }; 35 };
OLDNEW
« no previous file with comments | « tools/SkBitmapRegionCanvas.cpp ('k') | tools/SkBitmapRegionCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698