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 #ifndef SkBitmapRegionDecoder_DEFINED | |
| 9 #define SkBitmapRegionDecoder_DEFINED | |
| 10 | |
| 11 #include "SkBitmap.h" | |
| 12 #include "SkStream.h" | |
| 13 | |
| 14 /* | |
| 15 * This class aims to provide an interface to test multiple implementations of | |
| 16 * SkBitmapRegionDecoder. | |
| 17 */ | |
| 18 class SkBitmapRegionDecoder { | |
| 19 public: | |
| 20 | |
| 21 enum Strategy { | |
| 22 kCanvas_Strategy, | |
| 23 kSample_Strategy, | |
|
scroggo
2015/08/13 16:53:07
So this uses SkImageDecoder?
msarett
2015/08/13 18:10:23
Yeah - I think there will be a Sample strategy for
| |
| 24 // TODO (msarett): Add strategy for SkScaledCodec | |
| 25 }; | |
| 26 | |
| 27 static SkBitmapRegionDecoder* CreateBitmapRegionDecoder( | |
| 28 SkStreamRewindable* stream, Strategy strategy); | |
| 29 | |
| 30 virtual SkBitmap* decodeRegion(int start_x, int start_y, int width, | |
|
scroggo
2015/08/13 16:53:07
comments?
msarett
2015/08/13 18:10:23
Adding comments!
| |
| 31 int height, int sampleSize, | |
| 32 SkColorType prefColorType) = 0; | |
| 33 | |
| 34 int width() const { return fWidth; } | |
| 35 int height() const { return fHeight; } | |
| 36 | |
| 37 virtual ~SkBitmapRegionDecoder() {} | |
| 38 | |
| 39 protected: | |
| 40 | |
| 41 SkBitmapRegionDecoder(int width, int height) | |
| 42 : fWidth(width) | |
| 43 , fHeight(height) | |
| 44 {} | |
| 45 | |
| 46 private: | |
| 47 int fWidth; | |
|
scroggo
2015/08/13 16:53:07
Can these be const?
msarett
2015/08/13 18:10:23
Yes!
| |
| 48 int fHeight; | |
| 49 }; | |
| 50 | |
| 51 #endif | |
| OLD | NEW |