OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 SkImageInfo_DEFINED | 8 #ifndef SkImageInfo_DEFINED |
9 #define SkImageInfo_DEFINED | 9 #define SkImageInfo_DEFINED |
10 | 10 |
11 #include "SkMath.h" | 11 #include "SkMath.h" |
12 #include "SkRect.h" | 12 #include "SkRect.h" |
13 #include "SkSize.h" | 13 #include "SkSize.h" |
14 | 14 |
15 class SkReadBuffer; | 15 class SkReadBuffer; |
16 class SkWriteBuffer; | 16 class SkWriteBuffer; |
17 | 17 |
18 /** | 18 /** |
19 * This enum provides information about "how" an image will be used. For older
GPUs that do not | 19 * Describes how to interpret the alpha component of a pixel. |
20 * support non-power-of-2 tiling, some routines need to know this information b
efore they create | |
21 * a texture. | |
22 */ | |
23 enum SkImageUsageType { | |
24 /* Image will not be tiled (regardless of filtering) */ | |
25 kUntiled_SkImageUsageType, | |
26 | |
27 /* Image will be tiled, but not filtered */ | |
28 kTiled_Unfiltered_SkImageUsageType, | |
29 | |
30 /* Image will be tiled and filtered */ | |
31 kTiled_Filtered_SkImageUsageType, | |
32 }; | |
33 | |
34 /** | |
35 * Describes how to interpret the alpha compoent of a pixel. | |
36 */ | 20 */ |
37 enum SkAlphaType { | 21 enum SkAlphaType { |
38 kUnknown_SkAlphaType, | 22 kUnknown_SkAlphaType, |
39 | 23 |
40 /** | 24 /** |
41 * All pixels are stored as opaque. This differs slightly from kIgnore in | 25 * All pixels are stored as opaque. This differs slightly from kIgnore in |
42 * that kOpaque has correct "opaque" values stored in the pixels, while | 26 * that kOpaque has correct "opaque" values stored in the pixels, while |
43 * kIgnore may not, but in both cases the caller should treat the pixels | 27 * kIgnore may not, but in both cases the caller should treat the pixels |
44 * as opaque. | 28 * as opaque. |
45 */ | 29 */ |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 SkImageInfo(int width, int height, SkColorType ct, SkAlphaType at, SkColorPr
ofileType pt) | 309 SkImageInfo(int width, int height, SkColorType ct, SkAlphaType at, SkColorPr
ofileType pt) |
326 : fWidth(width) | 310 : fWidth(width) |
327 , fHeight(height) | 311 , fHeight(height) |
328 , fColorType(ct) | 312 , fColorType(ct) |
329 , fAlphaType(at) | 313 , fAlphaType(at) |
330 , fProfileType(pt) | 314 , fProfileType(pt) |
331 {} | 315 {} |
332 }; | 316 }; |
333 | 317 |
334 #endif | 318 #endif |
OLD | NEW |