| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #ifndef SkBitmap_DEFINED | 10 #ifndef SkBitmap_DEFINED |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 * 1-bit per pixel, (0 is transparent, 1 is opaque) | 45 * 1-bit per pixel, (0 is transparent, 1 is opaque) |
| 46 * Valid as a destination (target of a canvas), but not valid as a src. | 46 * Valid as a destination (target of a canvas), but not valid as a src. |
| 47 * i.e. you can draw into a 1-bit bitmap, but you cannot draw from one. | 47 * i.e. you can draw into a 1-bit bitmap, but you cannot draw from one. |
| 48 */ | 48 */ |
| 49 kA1_Config, | 49 kA1_Config, |
| 50 kA8_Config, //!< 8-bits per pixel, with only alpha specified (0
is transparent, 0xFF is opaque) | 50 kA8_Config, //!< 8-bits per pixel, with only alpha specified (0
is transparent, 0xFF is opaque) |
| 51 kIndex8_Config, //!< 8-bits per pixel, using SkColorTable to specify
the colors | 51 kIndex8_Config, //!< 8-bits per pixel, using SkColorTable to specify
the colors |
| 52 kRGB_565_Config, //!< 16-bits per pixel, (see SkColorPriv.h for packi
ng) | 52 kRGB_565_Config, //!< 16-bits per pixel, (see SkColorPriv.h for packi
ng) |
| 53 kARGB_4444_Config, //!< 16-bits per pixel, (see SkColorPriv.h for packi
ng) | 53 kARGB_4444_Config, //!< 16-bits per pixel, (see SkColorPriv.h for packi
ng) |
| 54 kARGB_8888_Config, //!< 32-bits per pixel, (see SkColorPriv.h for packi
ng) | 54 kARGB_8888_Config, //!< 32-bits per pixel, (see SkColorPriv.h for packi
ng) |
| 55 kLastConfig = kARGB_8888_Config, |
| 55 }; | 56 }; |
| 56 | 57 |
| 57 // do not add this to the Config enum, otherwise the compiler will let us | 58 // do not add this to the Config enum, otherwise the compiler will let us |
| 58 // pass this as a valid parameter for Config. | 59 // pass this as a valid parameter for Config. |
| 59 enum { | 60 enum { |
| 60 kConfigCount = kARGB_8888_Config + 1 | 61 kConfigCount = kARGB_8888_Config + 1 |
| 61 }; | 62 }; |
| 62 | 63 |
| 63 /** | 64 /** |
| 64 * Default construct creates a bitmap with zero width and height, and no pi
xels. | 65 * Default construct creates a bitmap with zero width and height, and no pi
xels. |
| (...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 811 | 812 |
| 812 // returns the address of the byte that contains the x coordinate | 813 // returns the address of the byte that contains the x coordinate |
| 813 inline uint8_t* SkBitmap::getAddr1(int x, int y) const { | 814 inline uint8_t* SkBitmap::getAddr1(int x, int y) const { |
| 814 SkASSERT(fPixels); | 815 SkASSERT(fPixels); |
| 815 SkASSERT(fConfig == kA1_Config); | 816 SkASSERT(fConfig == kA1_Config); |
| 816 SkASSERT((unsigned)x < fWidth && (unsigned)y < fHeight); | 817 SkASSERT((unsigned)x < fWidth && (unsigned)y < fHeight); |
| 817 return (uint8_t*)fPixels + y * fRowBytes + (x >> 3); | 818 return (uint8_t*)fPixels + y * fRowBytes + (x >> 3); |
| 818 } | 819 } |
| 819 | 820 |
| 820 #endif | 821 #endif |
| OLD | NEW |