OLD | NEW |
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 #ifndef SkBitmapRegionDecoder_DEFINED | 8 #ifndef SkBitmapRegionDecoder_DEFINED |
9 #define SkBitmapRegionDecoder_DEFINED | 9 #define SkBitmapRegionDecoder_DEFINED |
10 | 10 |
11 #include "SkBitmap.h" | 11 #include "SkBitmap.h" |
12 #include "SkBRDAllocator.h" | 12 #include "SkBRDAllocator.h" |
13 #include "SkEncodedFormat.h" | 13 #include "SkEncodedFormat.h" |
14 #include "SkStream.h" | 14 #include "SkStream.h" |
15 | 15 |
16 /* | 16 /* |
17 * This class aims to provide an interface to test multiple implementations of | 17 * This class aims to provide an interface to test multiple implementations of |
18 * SkBitmapRegionDecoder. | 18 * SkBitmapRegionDecoder. |
19 */ | 19 */ |
20 class SkBitmapRegionDecoder { | 20 class SkBitmapRegionDecoder { |
21 public: | 21 public: |
22 | 22 |
23 enum Strategy { | 23 enum Strategy { |
24 kCanvas_Strategy, // Draw to the canvas, uses SkCodec | |
25 kAndroidCodec_Strategy, // Uses SkAndroidCodec for scaling and subsettin
g | 24 kAndroidCodec_Strategy, // Uses SkAndroidCodec for scaling and subsettin
g |
26 }; | 25 }; |
27 | 26 |
28 /* | 27 /* |
29 * @param data Refs the data while this object exists, unrefs on destruc
tion | 28 * @param data Refs the data while this object exists, unrefs on destruc
tion |
30 * @param strategy Strategy used for scaling and subsetting | 29 * @param strategy Strategy used for scaling and subsetting |
31 * @return Tries to create an SkBitmapRegionDecoder, returns NULL on
failure | 30 * @return Tries to create an SkBitmapRegionDecoder, returns NULL on
failure |
32 */ | 31 */ |
33 static SkBitmapRegionDecoder* Create( | 32 static SkBitmapRegionDecoder* Create( |
34 SkData* data, Strategy strategy); | 33 SkData* data, Strategy strategy); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 : fWidth(width) | 80 : fWidth(width) |
82 , fHeight(height) | 81 , fHeight(height) |
83 {} | 82 {} |
84 | 83 |
85 private: | 84 private: |
86 const int fWidth; | 85 const int fWidth; |
87 const int fHeight; | 86 const int fHeight; |
88 }; | 87 }; |
89 | 88 |
90 #endif | 89 #endif |
OLD | NEW |