| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 /** | 48 /** |
| 49 * Copy the settings from the src into this bitmap. If the src has pixels | 49 * Copy the settings from the src into this bitmap. If the src has pixels |
| 50 * allocated, they will be shared, not copied, so that the two bitmaps will | 50 * allocated, they will be shared, not copied, so that the two bitmaps will |
| 51 * reference the same memory for the pixels. If a deep copy is needed, | 51 * reference the same memory for the pixels. If a deep copy is needed, |
| 52 * where the new bitmap has its own separate copy of the pixels, use | 52 * where the new bitmap has its own separate copy of the pixels, use |
| 53 * deepCopyTo(). | 53 * deepCopyTo(). |
| 54 */ | 54 */ |
| 55 SkBitmap(const SkBitmap& src); | 55 SkBitmap(const SkBitmap& src); |
| 56 | 56 |
| 57 /** |
| 58 * Copy the settings from the src into this bitmap. If the src has pixels |
| 59 * allocated, ownership of the pixels will be taken. |
| 60 */ |
| 61 SkBitmap(SkBitmap&& src); |
| 62 |
| 57 ~SkBitmap(); | 63 ~SkBitmap(); |
| 58 | 64 |
| 59 /** Copies the src bitmap into this bitmap. Ownership of the src bitmap's pi
xels remains | 65 /** Copies the src bitmap into this bitmap. Ownership of the src |
| 60 with the src bitmap. | 66 bitmap's pixels is shared with the src bitmap. |
| 61 */ | 67 */ |
| 62 SkBitmap& operator=(const SkBitmap& src); | 68 SkBitmap& operator=(const SkBitmap& src); |
| 69 |
| 70 /** Copies the src bitmap into this bitmap. Takes ownership of the src |
| 71 bitmap's pixels. |
| 72 */ |
| 73 SkBitmap& operator=(SkBitmap&& src); |
| 74 |
| 63 /** Swap the fields of the two bitmaps. This routine is guaranteed to never
fail or throw. | 75 /** Swap the fields of the two bitmaps. This routine is guaranteed to never
fail or throw. |
| 64 */ | 76 */ |
| 65 // This method is not exported to java. | 77 // This method is not exported to java. |
| 66 void swap(SkBitmap& other); | 78 void swap(SkBitmap& other); |
| 67 | 79 |
| 68 /////////////////////////////////////////////////////////////////////////// | 80 /////////////////////////////////////////////////////////////////////////// |
| 69 | 81 |
| 70 const SkImageInfo& info() const { return fInfo; } | 82 const SkImageInfo& info() const { return fInfo; } |
| 71 | 83 |
| 72 int width() const { return fInfo.width(); } | 84 int width() const { return fInfo.width(); } |
| (...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 813 | 825 |
| 814 inline SkPMColor SkBitmap::getIndex8Color(int x, int y) const { | 826 inline SkPMColor SkBitmap::getIndex8Color(int x, int y) const { |
| 815 SkASSERT(fPixels); | 827 SkASSERT(fPixels); |
| 816 SkASSERT(kIndex_8_SkColorType == this->colorType()); | 828 SkASSERT(kIndex_8_SkColorType == this->colorType()); |
| 817 SkASSERT((unsigned)x < (unsigned)this->width() && (unsigned)y < (unsigned)th
is->height()); | 829 SkASSERT((unsigned)x < (unsigned)this->width() && (unsigned)y < (unsigned)th
is->height()); |
| 818 SkASSERT(fColorTable); | 830 SkASSERT(fColorTable); |
| 819 return (*fColorTable)[*((const uint8_t*)fPixels + y * fRowBytes + x)]; | 831 return (*fColorTable)[*((const uint8_t*)fPixels + y * fRowBytes + x)]; |
| 820 } | 832 } |
| 821 | 833 |
| 822 #endif | 834 #endif |
| OLD | NEW |