OLD | NEW |
---|---|
(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 "SkScanlineDecoder.h" | |
11 | |
12 /* | |
13 * This class implements SkBitmapRegionDecoder by drawing to an SkCanvas. | |
scroggo
2015/09/01 22:05:28
I'm not sure this captures what is interesting abo
msarett
2015/09/02 18:02:23
It also does some subsetting. Since we can only d
| |
14 */ | |
15 class SkBitmapRegionCanvas : public SkBitmapRegionDecoder { | |
16 public: | |
17 | |
18 /* | |
19 * Takes ownership of pointer to decoder | |
20 */ | |
21 SkBitmapRegionCanvas(SkScanlineDecoder* decoder); | |
22 | |
23 /* | |
24 * This has several key differences from the Android version: | |
25 * Returns a Skia bitmap instead of an Android bitmap. | |
26 * Android version attempts to reuse a recycled bitmap. | |
27 */ | |
28 SkBitmap* decodeRegion(int start_x, int start_y, int width, int height, | |
29 int sampleSize, SkColorType prefColorType) override; | |
30 | |
31 private: | |
32 | |
33 SkAutoTDelete<SkScanlineDecoder> fDecoder; | |
34 | |
35 typedef SkBitmapRegionDecoder INHERITED; | |
36 | |
37 }; | |
OLD | NEW |