Chromium Code Reviews| 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 using an SkScanlineDecoder and | |
| 14 * an SkCanvas. It uses the scanline decoder to subset the height. It then | |
| 15 * will subset the width and scale by drawing to an SkCanvas. | |
| 16 */ | |
| 17 class SkBitmapRegionCanvas : public SkBitmapRegionDecoder { | |
| 18 public: | |
| 19 | |
| 20 /* | |
| 21 * Takes ownership of pointer to decoder | |
| 22 */ | |
| 23 SkBitmapRegionCanvas(SkScanlineDecoder* decoder); | |
| 24 | |
| 25 /* | |
| 26 * This has several key differences from the Android version: | |
|
scroggo
2015/09/02 21:32:24
"several", or two? Are there others?
msarett
2015/09/03 19:20:52
Yeah I think this covers the important ones, will
| |
| 27 * Returns a Skia bitmap instead of an Android bitmap. | |
| 28 * Android version attempts to reuse a recycled bitmap. | |
| 29 */ | |
| 30 SkBitmap* decodeRegion(int start_x, int start_y, int width, int height, | |
| 31 int sampleSize, SkColorType prefColorType) override; | |
| 32 | |
| 33 private: | |
| 34 | |
| 35 SkAutoTDelete<SkScanlineDecoder> fDecoder; | |
| 36 | |
| 37 typedef SkBitmapRegionDecoder INHERITED; | |
| 38 | |
| 39 }; | |
| OLD | NEW |