| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
| 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 SkBitmap_DEFINED | 8 #ifndef SkBitmap_DEFINED |
| 9 #define SkBitmap_DEFINED | 9 #define SkBitmap_DEFINED |
| 10 | 10 |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 | 191 |
| 192 /** Specify whether this bitmap is volatile. Bitmaps are not volatile by | 192 /** Specify whether this bitmap is volatile. Bitmaps are not volatile by |
| 193 default. Temporary bitmaps that are discarded after use should be | 193 default. Temporary bitmaps that are discarded after use should be |
| 194 marked as volatile. This provides a hint to the device that the bitmap | 194 marked as volatile. This provides a hint to the device that the bitmap |
| 195 should not be cached. Providing this hint when appropriate can | 195 should not be cached. Providing this hint when appropriate can |
| 196 improve performance by avoiding unnecessary overhead and resource | 196 improve performance by avoiding unnecessary overhead and resource |
| 197 consumption on the device. | 197 consumption on the device. |
| 198 */ | 198 */ |
| 199 void setIsVolatile(bool); | 199 void setIsVolatile(bool); |
| 200 | 200 |
| 201 /** Returns true if the bitmap contains a 3D lut. |
| 202 */ |
| 203 bool is3DLut() const; |
| 204 |
| 205 /** Specify whether this bitmap contains a 3D lut. Bitmaps are not 3D luts b
y default. |
| 206 */ |
| 207 void setIs3DLut(bool); |
| 208 |
| 201 /** Reset the bitmap to its initial state (see default constructor). If we a
re a (shared) | 209 /** Reset the bitmap to its initial state (see default constructor). If we a
re a (shared) |
| 202 owner of the pixels, that ownership is decremented. | 210 owner of the pixels, that ownership is decremented. |
| 203 */ | 211 */ |
| 204 void reset(); | 212 void reset(); |
| 205 | 213 |
| 206 /** | 214 /** |
| 207 * This will brute-force return true if all of the pixels in the bitmap | 215 * This will brute-force return true if all of the pixels in the bitmap |
| 208 * are opaque. If it fails to read the pixels, or encounters an error, | 216 * are opaque. If it fails to read the pixels, or encounters an error, |
| 209 * it will return false. | 217 * it will return false. |
| 210 * | 218 * |
| (...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 741 | 749 |
| 742 enum Flags { | 750 enum Flags { |
| 743 kImageIsVolatile_Flag = 0x02, | 751 kImageIsVolatile_Flag = 0x02, |
| 744 #ifdef SK_BUILD_FOR_ANDROID | 752 #ifdef SK_BUILD_FOR_ANDROID |
| 745 /* A hint for the renderer responsible for drawing this bitmap | 753 /* A hint for the renderer responsible for drawing this bitmap |
| 746 * indicating that it should attempt to use mipmaps when this bitmap | 754 * indicating that it should attempt to use mipmaps when this bitmap |
| 747 * is drawn scaled down. | 755 * is drawn scaled down. |
| 748 */ | 756 */ |
| 749 kHasHardwareMipMap_Flag = 0x08, | 757 kHasHardwareMipMap_Flag = 0x08, |
| 750 #endif | 758 #endif |
| 759 kIs3DLut_Flag = 0x10, |
| 751 }; | 760 }; |
| 752 | 761 |
| 753 SkImageInfo fInfo; | 762 SkImageInfo fInfo; |
| 754 | 763 |
| 755 uint32_t fRowBytes; | 764 uint32_t fRowBytes; |
| 756 | 765 |
| 757 uint8_t fFlags; | 766 uint8_t fFlags; |
| 758 | 767 |
| 759 void internalErase(const SkIRect&, U8CPU a, U8CPU r, U8CPU g, U8CPU b)const; | 768 void internalErase(const SkIRect&, U8CPU a, U8CPU r, U8CPU g, U8CPU b)const; |
| 760 | 769 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 874 | 883 |
| 875 inline SkPMColor SkBitmap::getIndex8Color(int x, int y) const { | 884 inline SkPMColor SkBitmap::getIndex8Color(int x, int y) const { |
| 876 SkASSERT(fPixels); | 885 SkASSERT(fPixels); |
| 877 SkASSERT(kIndex_8_SkColorType == this->colorType()); | 886 SkASSERT(kIndex_8_SkColorType == this->colorType()); |
| 878 SkASSERT((unsigned)x < (unsigned)this->width() && (unsigned)y < (unsigned)th
is->height()); | 887 SkASSERT((unsigned)x < (unsigned)this->width() && (unsigned)y < (unsigned)th
is->height()); |
| 879 SkASSERT(fColorTable); | 888 SkASSERT(fColorTable); |
| 880 return (*fColorTable)[*((const uint8_t*)fPixels + y * fRowBytes + x)]; | 889 return (*fColorTable)[*((const uint8_t*)fPixels + y * fRowBytes + x)]; |
| 881 } | 890 } |
| 882 | 891 |
| 883 #endif | 892 #endif |
| OLD | NEW |