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

Side by Side Diff: src/utils/SkBitmapRegionCanvas.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 "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 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698